Closed
Description
Description
The documentation explains how to throw errors instead of returning them:
onResponse({ response }) {
if (response.error) {
throw new Error(response.error.message);
}
}
Unfortunately it seems to be wrong because I get Property 'error' does not exist on type 'Response'
:
It's not just a matter of bad typings: the error prop just isn't there.
Reproduction
Copy-paste the throwing middleware snippet from the documentation and look for the typing error.
Expected result
The error should be available somewhere if we want to be able to throw it.
Checklist
- I’m willing to open a PR (see CONTRIBUTING.md)