Hi,
I am struggling to maintain api’s error messages using app sdk aka monday.api(query).
I am developing a client side react application and I am using monday.api(query) to do http request. For success scenarios there is no problem I can get the payload. But for error scenarios such as rate limit problems I can’t get the full json payload which should contain status code, error code etc. When there is an error scenario it returns like the following:
As you see it only contains the message as string. And this is the returning actual payload from the server including all information that I need. I took the SS from Chrome’s developer tools.
Here is my code:
Monday.api('query goes here')
.then(success_fn, function (err) {
console.log(err.data)
})
My library versions. I assume I am using the latest versions.
├── @mondaycom/apps-cli@2.4.0
├── @mondaycom/apps-sdk@3.0.2
├── monday-sdk-js@0.5.5
├── monday-ui-react-core@2.104.0
My api version is 2024-07.
My use case is just to retry the request in case of the fact that there is rate limit error. So I need status_code
and error_code
information. Parsing the raw string is not promising since it is subject to change and it is anti-pattern.
So the question is how can I get the full error payload that is returning from the server using Monday SDK?
Thanks in advance.