Skip to content

Commit 32739f7

Browse files
authored
Respect error handler's action for unsuccessful response errors (#13)
1 parent b9392a0 commit 32739f7

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

Source/LDSwiftEventSource.swift

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -250,6 +250,10 @@ class EventSourceDelegate: NSObject, URLSessionDataDelegate {
250250
os_log("Unsuccessful response: %d", log: logger, type: .info, httpResponse.statusCode)
251251
#endif
252252
errorHandlerAction = dispatchError(error: UnsuccessfulResponseError(responseCode: httpResponse.statusCode))
253+
254+
if errorHandlerAction == .shutdown {
255+
readyState = .shutdown
256+
}
253257
completionHandler(.cancel)
254258
}
255259
}

0 commit comments

Comments
 (0)