[typescript-fetch]: use ReponseError instead of throwing a response (#10477) - #10478
Conversation
|
Thanks for your contribution. |
b6b93c9 to
1416e84
Compare
I don't think so. Migrating existing code should be trivial enough. |
| } | ||
| }; | ||
|
|
||
| export class ResponseError extends Error { |
There was a problem hiding this comment.
note that this comes with some gotchas and generally won't work if your TS compile target is es5.
There was a problem hiding this comment.
As a workaround, you can match by error name if the code needs to be compiled to es5
if (err.name === 'ResponseError') {
...
}|
@macjohnny @amakhrov Is there any possibility this change will be included in version 6.0? |
|
@amakhrov are you fine with this change? |
|
@macjohnny yes, it looks reasonable, and is definitely better than throwing an arbitrary response object |
PR checklist
This is important, as CI jobs will verify all generator outputs of your HEAD commit as it would merge with master.
These must match the expectations made by your contribution.
You may regenerate an individual generator by passing the relevant config(s) as an argument to the script, for example
./bin/generate-samples.sh bin/configs/java*.For Windows users, please run the script in Git BASH.
master(5.3.0),6.0.x@TiFu @taxpon @sebastianhaas @kenisteward @Vrolijkx @macjohnny @topce @akehir @petejohansonxo @amakhrov