Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

HttpApi: Error response with string body causes decode error #3714

Open
fubhy opened this issue Oct 1, 2024 · 0 comments · Fixed by #3794
Open

HttpApi: Error response with string body causes decode error #3714

fubhy opened this issue Oct 1, 2024 · 0 comments · Fixed by #3794
Labels
bug Something isn't working

Comments

@fubhy
Copy link
Member

fubhy commented Oct 1, 2024

What version of Effect is running?

No response

What steps can reproduce the bug?

Error handling currently assumes that the response is JSON parsable. That's not always the case e.g. if the response body is just a pure string like "Rate limit exceeded".

https://github.com/Effect-TS/effect/blob/main/packages/platform/src/HttpApiClient.ts#L126

The recovery path here is fairly reasonable at first glance but I should be able to properly decode plain values here too instead of just JSON.

What is the expected behavior?

No response

What do you see instead?

No response

Additional information

No response

@fubhy fubhy added the bug Something isn't working label Oct 1, 2024
@tim-smart tim-smart linked a pull request Oct 17, 2024 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant