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

Error responses partially processed as successful responses #341

Open
bradjones1 opened this issue Mar 21, 2023 · 1 comment
Open

Error responses partially processed as successful responses #341

bradjones1 opened this issue Mar 21, 2023 · 1 comment

Comments

@bradjones1
Copy link

Describe the bug

While working on bubbling up more contextual data about error conditions (mostly on the HTTP transport) I discovered that error responses are being handled as successful, and then rejected as part of that processing. This (I think) is a result of how batches are handled. However, when handling a standalone response object, this resulted in not being able to directly catch the rejection, as well as the result event being emitted, if you are using the event emitter.

To Reproduce
Steps to reproduce the behavior:

  1. Request a method that results in an error response.
  2. Witness it is processed as a response, and then rejected.

Expected behavior
The response should be handled as an error at the outset.

Desktop (please complete the following information):

  • OS: Linux, Android and iOS
  • Browser: Firefox
  • Version 109.0.1

Additional context
This is fixed as part of my overall error handling improvements on #307

@bradjones1
Copy link
Author

This is specifically the changes at https://github.com/open-rpc/client-js/pull/307/files#r1143791280

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

No branches or pull requests

1 participant