Skip to content

Commit

Permalink
Attach timing info and URL to network errors
Browse files Browse the repository at this point in the history
Set an opaque timing info and the original request URL to the error
resposne, and call the processResponseDone callback to allow the caller
to report it. This should already be the case for reporting network
errors in the fetch() API.

Closes whatwg#1215
  • Loading branch information
noamr committed Sep 30, 2021
1 parent 8659a25 commit 6f8c023
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions fetch.bs
Original file line number Diff line number Diff line change
Expand Up @@ -2015,6 +2015,7 @@ known as an <dfn export id=concept-aborted-network-error>aborted network error</
<p>A <a>network error</a> is a <a for=/>response</a> whose
<a for=response>status</a> is always 0,
<a for=response>status message</a> is always the empty byte sequence,
<a for=response>timing allow passed flag</a> is always unset,
<a for=response>header list</a> is always empty, and
<a for=response>body</a> is always null.

Expand Down Expand Up @@ -4103,6 +4104,19 @@ steps:
<var>processBody</var>, <var>processBodyError</var>, and <var>fetchParams</var>'s
<a for="fetch params">task destination</a>.
</ol>

<li><p>If <var>fetchParams</var>'s <a for="fetch params">process response done</a> is non-null, and
<var>response</var> is a <a>network error</a>, then:

<ol>
<li><p>Set <var>response</var>'s <a for=response>URL list</a> to a <a for=/>list</a> containing
<var>fetchParams</var>'s <a for="fetch params">request</a>'s <a for=request>URL</a>.

<li><p><a>Queue a fetch task</a> to run <var>fetchParams</var>'s
<a for="fetch params">process response done</a> given <var>response</var>, with
<var>fetchParams</var>'s <a for="fetch params">task destination</a>.
</ol>

</ol>

<p>To <dfn>finalize response</dfn> given a <a for=/>fetch params</a> <var>fetchParams</var> and a
Expand Down

0 comments on commit 6f8c023

Please sign in to comment.