Last active
January 24, 2018 15:00
-
-
Save polac24/6f168fef32f362e1bb7e6c7390dab50a to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
let previousErrorHandler:ErrorHandleable = /// existing handler | |
// setup a handler | |
let errorHandler = previousErrorHandler.catch {error in | |
// Log all errors into console and pass it further | |
print(error) | |
throw error | |
}.catch { | |
// Stop propagation for all errors(no throwing) | |
} | |
... | |
errorHandler.throw(AppError.tokenExpired){ | |
// finally block | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment