Skip to content

Conversation

ptiurin
Copy link
Contributor

@ptiurin ptiurin commented Oct 7, 2025

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.

@ptiurin ptiurin marked this pull request as ready for review October 7, 2025 16:29
@ptiurin ptiurin requested a review from a team as a code owner October 7, 2025 16:29
Copy link

sonarqubecloud bot commented Oct 7, 2025

Copy link

@goprean goprean left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm.
Just for my education, what backend/3rd party call raises an error that is not a json?

@ptiurin
Copy link
Contributor Author

ptiurin commented Oct 8, 2025

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.

@goprean
Copy link

goprean commented Oct 8, 2025

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.

@ptiurin
Copy link
Contributor Author

ptiurin commented Oct 9, 2025

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants