Skip to content

Instantly share code, notes, and snippets.

@SergeyNarozhny
Created July 21, 2015 13:28
Show Gist options
  • Save SergeyNarozhny/844ad502bee47e99db8c to your computer and use it in GitHub Desktop.
Save SergeyNarozhny/844ad502bee47e99db8c to your computer and use it in GitHub Desktop.
AngularJS $exceptionHandler decorator
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