Created
January 4, 2016 15:02
-
-
Save an-tk/e7435ccc220b554d42ae to your computer and use it in GitHub Desktop.
log Angular errors with Rollbar
This file contains hidden or 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
angular.module('app').config(function($provide) { | |
$provide.decorator('$exceptionHandler', ['$delegate', '$injector', function($delegate, $injector) { | |
var $location; | |
return function(exception, cause) { | |
$location = $location || $injector.get('$location'); | |
var url = $location.absUrl(); | |
$delegate(exception, cause); | |
Rollbar.error( url + ': ' + exception.stack); | |
}; | |
}]); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment