From fc7582f31b30b7b1c1c27ff47e923290ecf410dd Mon Sep 17 00:00:00 2001 From: Maru Date: Wed, 10 Mar 2021 00:34:18 +0300 Subject: [PATCH] Passing error when URLSession task completes --- EventSource/EventSource.swift | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/EventSource/EventSource.swift b/EventSource/EventSource.swift index 8249968..fc6d353 100644 --- a/EventSource/EventSource.swift +++ b/EventSource/EventSource.swift @@ -177,7 +177,7 @@ open class EventSource: NSObject, EventSourceProtocol, URLSessionDataDelegate { } let reconnect = shouldReconnect(statusCode: responseStatusCode) - mainQueue.async { [weak self] in self?.onComplete?(responseStatusCode, reconnect, nil) } + mainQueue.async { [weak self] in self?.onComplete?(responseStatusCode, reconnect, error as NSError?) } } open func urlSession(_ session: URLSession,