Bug 186156

Summary: Update Fetch code to provide more useful exception messages
Product: WebKit Reporter: Chris Dumez <cdumez>
Component: WebCore Misc.Assignee: Chris Dumez <cdumez>
Status: RESOLVED FIXED    
Severity: Normal CC: commit-queue, webkit-bug-importer, youennf
Priority: P2 Keywords: InRadar
Version: WebKit Nightly Build   
Hardware: Unspecified   
OS: Unspecified   
Bug Depends on:    
Bug Blocks: 184245    
Attachments:
Description Flags
Patch
none
Patch
none
Patch
none
Patch none

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>