Skip to content

Commit 7586508

Browse files
committed
Fine tuning - Tested
1 parent e13a461 commit 7586508

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

Foundation/URLSession/URLSessionTask.swift

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -260,9 +260,9 @@ open class URLSessionTask : NSObject, NSCopying {
260260
userInfo[NSURLErrorFailingURLStringErrorKey] = url.absoluteString
261261
}
262262
let error = NSError(domain: NSURLErrorDomain,
263-
code: URLError.unsupportedURL.rawValue,
263+
code: NSURLErrorUnsupportedURL,
264264
userInfo: userInfo)
265-
_ProtocolClient().urlProtocol(task: self, didFailWithError: error)
265+
_ProtocolClient().urlSessionTask(self, didFailWithError: URLError(_nsError: error))
266266
}
267267
}
268268
}
@@ -588,10 +588,10 @@ extension _ProtocolClient : URLProtocolClient {
588588

589589
func urlProtocol(_ protocol: URLProtocol, didFailWithError error: Error) {
590590
guard let task = `protocol`.task else { fatalError() }
591-
urlProtocol(task: task, didFailWithError: error)
591+
urlSessionTask(task, didFailWithError: error)
592592
}
593593

594-
func urlProtocol(task: URLSessionTask, didFailWithError error: Error) {
594+
func urlSessionTask(_ task: URLSessionTask, didFailWithError error: Error) {
595595
guard let session = task.session as? URLSession else { fatalError() }
596596
switch session.behaviour(for: task) {
597597
case .taskDelegate(let delegate):

0 commit comments

Comments
 (0)