Skip to content

Commit 1d56e6b

Browse files
authored
Merge pull request #636 from seabaylea/SR-2632-completeWithError
2 parents 0626a97 + 7e1dbf1 commit 1d56e6b

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

Foundation/NSURLSession/NSURLSessionDelegate.swift

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ public protocol URLSessionDelegate : NSObjectProtocol {
5353
* invalid because of a systemic error or when it has been
5454
* explicitly invalidated, in which case the error parameter will be nil.
5555
*/
56-
func urlSession(_ session: URLSession, didBecomeInvalidWithError error: NSError?)
56+
func urlSession(_ session: URLSession, didBecomeInvalidWithError error: Error?)
5757

5858
/* If implemented, when a connection level authentication challenge
5959
* has occurred, this delegate will be given the opportunity to
@@ -68,7 +68,7 @@ public protocol URLSessionDelegate : NSObjectProtocol {
6868
}
6969

7070
extension URLSessionDelegate {
71-
public func urlSession(_ session: URLSession, didBecomeInvalidWithError error: NSError?) { }
71+
public func urlSession(_ session: URLSession, didBecomeInvalidWithError error: Error?) { }
7272
public func urlSession(_ session: URLSession, didReceive challenge: URLAuthenticationChallenge, completionHandler: @escaping (URLSession.AuthChallengeDisposition, URLCredential?) -> Void) { }
7373
}
7474

@@ -118,7 +118,7 @@ public protocol URLSessionTaskDelegate : URLSessionDelegate {
118118
/* Sent as the last message related to a specific task. Error may be
119119
* nil, which implies that no error occurred and this task is complete.
120120
*/
121-
func urlSession(_ session: URLSession, task: URLSessionTask, didCompleteWithError error: NSError?)
121+
func urlSession(_ session: URLSession, task: URLSessionTask, didCompleteWithError error: Error?)
122122
}
123123

124124
extension URLSessionTaskDelegate {
@@ -136,7 +136,7 @@ extension URLSessionTaskDelegate {
136136

137137
public func urlSession(_ session: URLSession, task: URLSessionTask, didSendBodyData bytesSent: Int64, totalBytesSent: Int64, totalBytesExpectedToSend: Int64) { }
138138

139-
public func urlSession(_ session: URLSession, task: URLSessionTask, didCompleteWithError error: NSError?) { }
139+
public func urlSession(_ session: URLSession, task: URLSessionTask, didCompleteWithError error: Error?) { }
140140
}
141141

142142
/*

Foundation/NSURLSession/NSURLSessionTask.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -865,7 +865,7 @@ extension URLSessionTask {
865865
case .taskDelegate(let delegate):
866866
guard let s = session as? URLSession else { fatalError() }
867867
s.delegateQueue.addOperation {
868-
delegate.urlSession(s, task: self, didCompleteWithError: error)
868+
delegate.urlSession(s, task: self, didCompleteWithError: error as Error)
869869
}
870870
case .noDelegate:
871871
break

0 commit comments

Comments
 (0)