forked from PatrickJS/angular-raven
-
Notifications
You must be signed in to change notification settings - Fork 0
/
angular-raven.min.js
1 lines (1 loc) · 1.45 KB
/
angular-raven.min.js
1
!function(e,n,t){"use strict";e.provider("Raven",function(){var e=null;this.development=function(n){return e=n||e,this},this.$get=["$window","$log",function(r,a){var i={VERSION:r.Raven?r.Raven.VERSION:"development",TraceKit:r.Raven?r.Raven.TraceKit:"development",captureException:function(n,t){a.error("Raven: Exception ",n,t),e||r.Raven.captureException(n,t)},captureMessage:function(n,t){e?a.error("Raven: Message ",n,t):r.Raven.captureMessage(n,t)},setUser:function(n){e?a.info("Raven: User ",n):r.Raven.setUser?r.Raven.setUser(n):r.Raven.setUserContext&&r.Raven.setUserContext(n)},setUserContext:function(n){e?a.info("Raven: User ",n):r.Raven.setUserContext?r.Raven.setUserContext(n):r.Raven.setUser&&r.Raven.setUser(n)},lastException:function(){e?a.error("Raven: Last Exception"):r.Raven.lastException()},context:function(e,r,a){var i=this;return n.isFunction(e)&&(a=r||[],r=e,e=t),i.wrap(e,r).apply(i,a)},wrap:function(e,r){function a(){for(var n=[],t=arguments.length;t--;)n[t]=i.wrap(e,arguments[t]);try{return r.apply(this,n)}catch(a){i.captureException(a,e)}}var i=this;if(n.isUndefined(r)&&!n.isFunction(e))return e;if(n.isFunction(e)&&(r=e,e=t),!n.isFunction(r))return r;if(r.__raven__)return r;for(var o in r)r.hasOwnProperty(o)&&(a[o]=r[o]);return a.__raven__=!0,a}};return i}]}),e.factory("$exceptionHandler",["Raven",function(e){return function(n,t){e.captureException(n,t)}}]),e.factory("$raven",["Raven",function(e){return e}])}(angular.module("ngRaven",[]),angular);