Created
October 13, 2014 16:42
-
-
Save cubicleDowns/f5fade38e2fb1e1934c7 to your computer and use it in GitHub Desktop.
Angular Error Exception Module
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
//inject the module as such | |
var myApp = angular.module("myApp", ['ngExceptions']) | |
// put this in one file. | |
(function(window, angular) {'use strict'; | |
/** | |
* @ngdoc module | |
* @name ngExceptions | |
* @description | |
* | |
* # ngExceptions | |
*/ | |
// define ngExceptions module | |
var ngExceptions = angular.module('ngExceptions', []) | |
.config([ '$provide', function($provide){ $provide.decorator('$exceptionHandler', function(){ | |
return function(exception, cause){ | |
console.log("angularError", {'error': exception, 'userdata': {'cause': cause}}); | |
}; | |
}); | |
}]); | |
})(window, window.angular); | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Replace console.log with whatever reporting system you use.