Hi all,
do you know if this article about Error Codes is up to date?
As far as I can see I don’t receive any error_code, status_code, error_message or error_data fields, but a simple errors array containing a message field.
For example, triggering an error on purpose by calling a non-existing xxx field, I get the following errors array:
What I have realized is that, even though monday.com does send these error_code , status_code , error_message or error_data fields, they are not catchable making them essentially useless.
If you open your console and check the network tab, you might see these error fields.
I thought it was only on my end but since @rob is also reporting the issue, it seems that it might be a general problem
The Apollo Client (GraphQL) can be configured to throw an exception on on the payload having an errors object. This way Apollo Client (or Apollo Link) will handle a 200 with an errors object as an exception.
However Apollo does not look for the non-standard “error_codes” field in the response as that is not part of the GraphQL spec. You’re then required check your response object for “error_code” and/or lack of a “data” object and throw an exception yourself.
The “errors” object should be used for any errors related to an actual operation - such as column_id not existing on a board, item_id missing, etc.
Apollo Client error handling unfortunately the server-side SDK does not use Apollo Client (though Apollo Link work with some setup, rather than the SDK).
I would highly encourage the monday.com team to move all API errors that are caught (invalid column id xxx) as part of the “errors” object. However, i acknowledge the difficulty of this, especially if client side (web ui) code does not have exception handling for these errors in place.
Hi @Matias.Monday, is any update available on this issue?
A reliable method for parsing and handling errors is an important requirement for any production application. The docs remain incorrect, and the error codes defined there are not returned. Thanks.