Replies: 1 comment
-
Hi @patrykzak - at the moment, logging instance of If it's not possible to change the status code that's being returned by your endpoint, and you need to ensure that you're logging any returned errors, then it sounds like in your situation, you would unfortunately need to always inspect the returned response to see if there are errors. It's definitely not ideal, but given that you're working with an endpoint that doesn't seem to follow best practices for returning a status code, I'm not sure if you would have any other options. |
Beta Was this translation helpful? Give feedback.
-
I saw plenty of discussions and I do not see any agreement on that topic.
I have custom build logger to save requests and responses, which works ok while investigating a bug, but it's desired to send email alerts on errors.
However, since I get 200 status codes and errors in the body, with different field names related to messages, status codes in each REST request (also working with middleware so maybe receiving 200 with error in the response body has some explanation).
But I am still not convinced if that's the way it should work, handling this errors in response bodies will introduce a lot of error handling strategies tight 1:1 to each request, which I do not want.
So I read recently about NebulaLogger and tried to find if you guys implement anything to track it,
but I have not seen any code related to that.
Does that mean that as a good practice I should never seek for errors in response body when I get success status codes?
Beta Was this translation helpful? Give feedback.
All reactions