Skip to content

Instantly share code, notes, and snippets.

@wwwmarcos
Last active August 31, 2016 11:57
Show Gist options
  • Save wwwmarcos/1119cba0d2f883c17225ab5bafd16721 to your computer and use it in GitHub Desktop.
Save wwwmarcos/1119cba0d2f883c17225ab5bafd16721 to your computer and use it in GitHub Desktop.
(function() {
'use strict';
angular
.module('ExceptionHandler', [])
.factory('$exceptionHandler', exceptionHandler);
exceptionHandler.$inject = ['message', '$log']
function exceptionHandler(message, $log){
return function handle(exception, cause){
$log.warn(exception, cause);
message.warning(exception.message || exception);
};
};
})();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment