chore(NoTicket): Improve plaintext error handling#462
Conversation
|
goprean
left a comment
There was a problem hiding this comment.
lgtm.
Just for my education, what backend/3rd party call raises an error that is not a json?
The one I stumbled upon happens when engine is stopped and autostart is off. If you try to query it you get an error in plaintext. |
In my opinion this should be fix on the backend. The same API returning different error formats depending on the state of the engine. Could you at least ask on packdb or gateway to see if this is the desired behavior? Because otherwise we would have to change other drivers as well. |
Not necessarily. Python SDK just assumed all errors would be json. We should be able to handle non-json errors, especially is the server is saying that it's returning a text/plain in the result headers. |



We assumed all the errors that are not recognised by us will be sent in a structured format, with JSON.
However, doesn't look like it's always the case.
We should be able to gracefully handle plaintext errors as well.