zendesk_api_client_rb icon indicating copy to clipboard operation
zendesk_api_client_rb copied to clipboard

Improve Error Message for Record Invalid Errors

Open conradbeach opened this issue 2 years ago • 0 comments

While attempting to merge 2 users together in Zendesk, I received a 422 response with the response body {"error"=>"You cannot merge Customer Name while they have an external ID."}. However, this error message was not included in the raised exception. As a result, our exception monitoring tool only showed ZendeskAPI::Error::RecordInvalid: {} without any details. This made determining the actual issue challenging.

I think modifying the code that generates the message for ZendeskAPI::Error::RecordInvalid errors to use the message in the error key of the response body, if necessary, will improve the usability of this exception.

conradbeach avatar Aug 23 '22 20:08 conradbeach