Created
May 1, 2014 12:44
-
-
Save kkurni/eeae51aab2a7b3554554 to your computer and use it in GitHub Desktop.
errorception handler for angularjs
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
app.factory('$exceptionHandler', function ($log) { | |
return function (exception, cause) { | |
exception.message += ' (caused by "' + cause + '")'; | |
$log.error(exception); | |
throw exception; | |
}; | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment