Bug 186156 - Update Fetch code to provide more useful exception messages
Summary: Update Fetch code to provide more useful exception messages
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: WebCore Misc. (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Chris Dumez
URL:
Keywords: InRadar
Depends on:
Blocks: 184245
  Show dependency treegraph
 
Reported: 2018-05-31 12:26 PDT by Chris Dumez
Modified: 2018-06-04 16:18 PDT (History)
3 users (show)

See Also:


Attachments
Patch (39.16 KB, patch)
2018-06-04 13:47 PDT, Chris Dumez
no flags Details | Formatted Diff | Diff
Patch (39.38 KB, patch)
2018-06-04 14:39 PDT, Chris Dumez
no flags Details | Formatted Diff | Diff
Patch (39.68 KB, patch)
2018-06-04 15:26 PDT, Chris Dumez
no flags Details | Formatted Diff | Diff
Patch (39.66 KB, patch)
2018-06-04 15:50 PDT, Chris Dumez
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Chris Dumez 2018-05-31 12:26:55 PDT
Update Fetch code to provide more useful exception messages.
Comment 1 Chris Dumez 2018-06-04 13:47:06 PDT
Created attachment 341915 [details]
Patch
Comment 2 Chris Dumez 2018-06-04 14:39:08 PDT
Created attachment 341920 [details]
Patch
Comment 3 youenn fablet 2018-06-04 14:52:03 PDT
Comment on attachment 341920 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=341920&action=review

> Source/WebCore/Modules/fetch/FetchHeaders.cpp:41
> +        return Exception { TypeError, makeString("Invalid header value: '", value, "'") };

Might be nice to give the header name as well?

> Source/WebCore/workers/service/context/ServiceWorkerFetch.cpp:49
> +        client->didFail(ResourceError { errorDomainWebKitInternal, 0, URL(), ASCIILiteral("Response is null") });

We should try to get more interesting error messages here, based on the rejected promise value for instance.
I can add this as a follow-up.

> Source/WebKit/StorageProcess/ServiceWorker/WebSWServerConnection.cpp:259
> +void WebSWServerConnection::didFailFetch(FetchIdentifier fetchIdentifier, ResourceError&& error)

Can probably be a const ResourceError& given it is only used by Messages::ServiceWorkerClientFetch::DidFail
Comment 4 Chris Dumez 2018-06-04 15:26:27 PDT
Created attachment 341923 [details]
Patch
Comment 5 WebKit Commit Bot 2018-06-04 15:28:33 PDT
Comment on attachment 341923 [details]
Patch

Rejecting attachment 341923 [details] from commit-queue.

Failed to run "['/Volumes/Data/EWS/WebKit/Tools/Scripts/webkit-patch', '--status-host=webkit-queues.webkit.org', '--bot-id=webkit-cq-03', 'validate-changelog', '--check-oops', '--non-interactive', 341923, '--port=mac']" exit_code: 1 cwd: /Volumes/Data/EWS/WebKit

ChangeLog entry in Source/WebKit/ChangeLog contains OOPS!.

Full output: http://webkit-queues.webkit.org/results/7983650
Comment 6 Chris Dumez 2018-06-04 15:50:53 PDT
Created attachment 341928 [details]
Patch
Comment 7 WebKit Commit Bot 2018-06-04 16:17:58 PDT
Comment on attachment 341928 [details]
Patch

Clearing flags on attachment: 341928

Committed r232484: <https://trac.webkit.org/changeset/232484>
Comment 8 WebKit Commit Bot 2018-06-04 16:18:00 PDT
All reviewed patches have been landed.  Closing bug.
Comment 9 Radar WebKit Bug Importer 2018-06-04 16:18:16 PDT
<rdar://problem/40785465>