Last active
August 31, 2016 11:57
-
-
Save wwwmarcos/1119cba0d2f883c17225ab5bafd16721 to your computer and use it in GitHub Desktop.
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
(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