Skip to content

Commit 8367ea8

Browse files
albertaleksieievAnton Pogonets
authored andcommitted
Dev: handle fatalError for HTTPURLProtocol
1 parent f2a3791 commit 8367ea8

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

Foundation/URLSession/http/HTTPURLProtocol.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ internal class _HTTPURLProtocol: URLProtocol {
5656
suspend()
5757
} else {
5858
self.internalState = .transferFailed
59-
guard let error = self.task?.error else { fatalError() }
59+
let error = self.task?.error ?? NSError(domain: NSURLErrorDomain, code: URLError.Code.unknown.rawValue)
6060
completeTask(withError: error)
6161
}
6262
}

0 commit comments

Comments
 (0)