[Webkit-unassigned] [Bug 215771] New: Unhandled Promise Rejection: Abort Error: Fetch is aborted

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Mon Aug 24 09:59:28 PDT 2020


https://bugs.webkit.org/show_bug.cgi?id=215771

            Bug ID: 215771
           Summary: Unhandled Promise Rejection: Abort Error: Fetch is
                    aborted
           Product: WebKit
           Version: Safari 13
          Hardware: All
                OS: macOS 10.15
            Status: NEW
          Severity: Normal
          Priority: P2
         Component: New Bugs
          Assignee: webkit-unassigned at lists.webkit.org
          Reporter: sobue at ischemaview.com

Lots of `Unhandled Promise Rejection: Abort Error: Fetch is aborted` error is being displayed in console, when network is disconnected while data from `ReadableStream` is being read.

The sample code below will abort stream data reading after 1 second.
Chrome browser does not throw an error and ends stream reading gracefully, however Safari and WkWebView threw lots of error in console.

--
```
const url = 'https://...'; // URL which takes more than 1 second to download
function test(url) {
  const abortController = new AbortController();
  window.setTimeout(() => {
    abortController.abort();
  }, 1000);
  window.fetch(url, { signal: abortController.signal }).then(response => {
    const reader = response.body.getReader();
    reader.read().then(function processData({ value, done}) {
      if (done) {
        return;
      }
      return reader.read().then(processData);
    })
    .catch(error => console.error('reader error handled gracefully', error));
  });
}

test(url);
```

-- 
You are receiving this mail because:
You are the assignee for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.webkit.org/pipermail/webkit-unassigned/attachments/20200824/7e69095d/attachment.htm>


More information about the webkit-unassigned mailing list