Created
July 21, 2015 13:28
-
-
Save SergeyNarozhny/844ad502bee47e99db8c to your computer and use it in GitHub Desktop.
AngularJS $exceptionHandler decorator
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.config(function($provide){ | |
$provide.decorator("$exceptionHandler", ["$delegate", function($delegate){ | |
return function(exception, cause) | |
{ | |
exception.message = "Some exception message"; | |
$delegate(exception, cause); //call out basic implementation | |
alert(exception.message); //our custom alert | |
} | |
}]); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment