⚠ Archived content — this site is no longer maintained.   Current WebKit documentation is at docs.webkit.org.

Changeset 243565 in webkit


Ignore:
Timestamp:
Mar 27, 2019, 2:48:04 PM (7 years ago)
Author:
Keith Rollin
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:]):

Location:
trunk/Source/WebKit
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebKit/ChangeLog

    r243562 r243565  
     12019-03-27  Keith Rollin  <krollin@apple.com>
     2
     3        Include the CFNetworking task UUID to the NSError when a resource-load fails
     4        https://bugs.webkit.org/show_bug.cgi?id=196156
     5
     6        Reviewed by Alex Christensen.
     7
     8        In order to help track the connection between a failed resource-load
     9        and a user-visible error message, include the CFNetworking task UUID
     10        in the associated error as an element of the userInfo property. This
     11        can then be pulled out and reported in the logging at the point the
     12        error is reported to the user.
     13
     14        * NetworkProcess/cocoa/NetworkSessionCocoa.mm:
     15        (-[WKNetworkSessionDelegate URLSession:task:didCompleteWithError:]):
     16
    1172019-03-27  Chris Dumez  <cdumez@apple.com>
    218
  • trunk/Source/WebKit/NetworkProcess/cocoa/NetworkSessionCocoa.mm

    r243524 r243565  
    607607
    608608    LOG(NetworkSession, "%llu didCompleteWithError %@", task.taskIdentifier, error);
     609
     610    if (error) {
     611        NSDictionary *oldUserInfo = [error userInfo];
     612        NSMutableDictionary *newUserInfo = oldUserInfo ? [NSMutableDictionary dictionaryWithDictionary:oldUserInfo] : [NSMutableDictionary dictionary];
     613        newUserInfo[@"networkTaskDescription"] = [task description];
     614        error = [NSError errorWithDomain:[error domain] code:[error code] userInfo:newUserInfo];
     615    }
     616
    609617    if (auto* networkDataTask = [self existingTask:task])
    610618        networkDataTask->didCompleteWithError(error, networkDataTask->networkLoadMetrics());
Note: See TracChangeset for help on using the changeset viewer.