Skip to content

Commit

Permalink
fix(ext/flash): Correctly handle errors for chunked responses (denola…
Browse files Browse the repository at this point in the history
…nd#17303)

The leading cause of the problem was that `handleResponse` has
`tryRespondChunked` passed as an argument, which in turn is implemented
as a call to `core.ops.op_try_flash_respond_chuncked`, that throws in
the repro code.

`handleResponse` was not handled correctly, as it not returned any
value, and had no `catch` attached to it.
It also effectively was never correctly handled inside two other blocks
with `resp.then` and `PromisePrototypeCatch(PromisePrototypeThen(resp,
"..."))` as well, as it just short-circuited the promise with an empty
resolve, instead of relying on the last `(async () => {})` block.

This change makes `handleResponse` return a correct value and attach
`onError` handler to the "non-thenable" variant of response handling
code.
  • Loading branch information
kamilogorek committed Jan 14, 2023
1 parent 1d7203c commit 429ccff
Showing 0 changed files with 0 additions and 0 deletions.

0 comments on commit 429ccff

Please sign in to comment.