Skip to main content

Error format thrown by API changed (without notice?)

  • November 1, 2020
  • 6 replies
  • 5874 views

basdebruin

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?

This topic has been closed for replies.

6 replies

basdebruin
  • Author
  • Community Expert
  • November 2, 2020

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?


Spunkie
  • New Participant
  • November 2, 2020

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

basdebruin
  • Author
  • Community Expert
  • November 2, 2020

hi @Spunkie

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


dsilva
Forum|alt.badge.img
  • Participating Frequently
  • November 6, 2020

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


basdebruin
  • Author
  • Community Expert
  • November 6, 2020

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.


dsilva
Forum|alt.badge.img
  • Participating Frequently
  • November 9, 2020

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

-Daniel