Title: [243565] trunk/Source/WebKit
Revision
243565
Author
krol...@apple.com
Date
2019-03-27 14:48:04 -0700 (Wed, 27 Mar 2019)

Log Message

Include the CFNetworking task UUID to the NSError when a resource-load fails
https://bugs.webkit.org/show_bug.cgi?id=196156

Reviewed by Alex Christensen.

In order to help track the connection between a failed resource-load
and a user-visible error message, include the CFNetworking task UUID
in the associated error as an element of the userInfo property. This
can then be pulled out and reported in the logging at the point the
error is reported to the user.

* NetworkProcess/cocoa/NetworkSessionCocoa.mm:
(-[WKNetworkSessionDelegate URLSession:task:didCompleteWithError:]):

Modified Paths

Diff

Modified: trunk/Source/WebKit/ChangeLog (243564 => 243565)


--- trunk/Source/WebKit/ChangeLog	2019-03-27 21:09:44 UTC (rev 243564)
+++ trunk/Source/WebKit/ChangeLog	2019-03-27 21:48:04 UTC (rev 243565)
@@ -1,3 +1,19 @@
+2019-03-27  Keith Rollin  <krol...@apple.com>
+
+        Include the CFNetworking task UUID to the NSError when a resource-load fails
+        https://bugs.webkit.org/show_bug.cgi?id=196156
+
+        Reviewed by Alex Christensen.
+
+        In order to help track the connection between a failed resource-load
+        and a user-visible error message, include the CFNetworking task UUID
+        in the associated error as an element of the userInfo property. This
+        can then be pulled out and reported in the logging at the point the
+        error is reported to the user.
+
+        * NetworkProcess/cocoa/NetworkSessionCocoa.mm:
+        (-[WKNetworkSessionDelegate URLSession:task:didCompleteWithError:]):
+
 2019-03-27  Chris Dumez  <cdu...@apple.com>
 
         [ iOS Sim ] REGRESSION (r242277) Layout Test http/tests/cookies/same-site/lax-samesite-cookie-after-cross-site-history-load.php is a flaky timeout

Modified: trunk/Source/WebKit/NetworkProcess/cocoa/NetworkSessionCocoa.mm (243564 => 243565)


--- trunk/Source/WebKit/NetworkProcess/cocoa/NetworkSessionCocoa.mm	2019-03-27 21:09:44 UTC (rev 243564)
+++ trunk/Source/WebKit/NetworkProcess/cocoa/NetworkSessionCocoa.mm	2019-03-27 21:48:04 UTC (rev 243565)
@@ -606,6 +606,14 @@
         return;
 
     LOG(NetworkSession, "%llu didCompleteWithError %@", task.taskIdentifier, error);
+
+    if (error) {
+        NSDictionary *oldUserInfo = [error userInfo];
+        NSMutableDictionary *newUserInfo = oldUserInfo ? [NSMutableDictionary dictionaryWithDictionary:oldUserInfo] : [NSMutableDictionary dictionary];
+        newUserInfo[@"networkTaskDescription"] = [task description];
+        error = [NSError errorWithDomain:[error domain] code:[error code] userInfo:newUserInfo];
+    }
+
     if (auto* networkDataTask = [self existingTask:task])
         networkDataTask->didCompleteWithError(error, networkDataTask->networkLoadMetrics());
     else if (error) {
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to