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

XRPC shouldn't throw on non-200 responses #27

Open
mary-ext opened this issue Feb 4, 2025 · 0 comments
Open

XRPC shouldn't throw on non-200 responses #27

mary-ext opened this issue Feb 4, 2025 · 0 comments
Labels
breaking change Issues that involve doing a breaking change

Comments

@mary-ext
Copy link
Owner

mary-ext commented Feb 4, 2025

It's frankly annoying to have to handle happy and sad path separately in a try..catch, especially when they can be a quite common thing.

Let's avoid this, we should only throw on exceptional scenarios (e.g. unexpected content-type from #9)

We'll follow a similar response as oazapfts, like so:

const { status, data, headers } = await rpc.get('...');
@mary-ext mary-ext added the breaking change Issues that involve doing a breaking change label Feb 4, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
breaking change Issues that involve doing a breaking change
Projects
None yet
Development

No branches or pull requests

1 participant