angular.module('exceptionOverride', []).factory('$exceptionHandler', function() { return function(exception, cause) { exception.message += ' (caused by "' + cause + '")'; throw exception; }; });
代码虽然是官方的,只是基础的介绍,具体应用还需要更细致的设计.
统一的异常(消息)处理是架构设计的重要环节,是统一风格的具体体现.