Skip to main content

Hi all,


I noticed that the error format thrown by the API has been changed. My code used to check



response.errors[0].message



but I do see a different error format now



{

“error_code”: “CreateBoardException”,

“status_code”: 400,

“error_message”: “Failed to create board from predefined template”,

“error_data”: {}

}



Is this really changed?

Did I miss any announcement?

Shouldn’t app developers made aware of such important change?


OR are there different error formats for queries and mutations?

Looks like both formats mentioned are still used. What I need to understand is which format is used in case of which error. Any documentation on this that I missed?


Is this with api access through monday-sdk-js or directly to the api?


I know the sdk had a recent release that changed error handling behaviour. Haven’t had a chance to test it out myself though.


GitHub

hi @Spunkie


This is with mondayClient.api so directly to the API. There are two different error formats which makes error handling little weird.


Hey @basdebruin - no changes have been made to the API or the way that error formatting occurs.


The API responds with different error formats depending on the type of error occurring. For example, when I try to run a query with invalid fields, it returns more information (like the message and locations):


image


The error you posted above is more inline with an error monday is throwing (rather than a GraphQL error such as mine). This could mean a few things - such as hitting the complexity limit or having an invalid template ID.


-Daniel


hi @dsilva


Thank you for confirming that. That means we need to do error checking on two different way for each API call. I went ahead and have done that, but in my opinion it would be nicer to have only one error format in place.


Understood @basdebruin - I’ll be sure to pass the feedback along internally.


-Daniel