Created
December 22, 2015 07:28
-
-
Save Azdaroth/9aeca9b071b8308c7907 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 errorHandlers = { | |
isAuthenticationError: transitionAway, | |
IsImportantDataError: showError, | |
isUnimportantDataError: keepTrying | |
}; | |
let errorHandler = Object.keys(errorHandlers).find(function(isCurrentError) { isCurrentError(errorFromTryCatch) }); | |
errorHandler(errorFromTryCatch); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment