@@ -4,7 +4,7 @@ declare var exceptionless;
44
55angular . module ( 'exceptionless' , [ ] )
66 . constant ( '$ExceptionlessClient' , exceptionless . ExceptionlessClient . default )
7- . factory ( 'exceptionlessHttpInterceptor' , [ '$q' , '$ExceptionlessClient' , function ( $q , $ExceptionlessClient ) {
7+ . factory ( 'exceptionlessHttpInterceptor' , [ '$q' , '$ExceptionlessClient' , ( $q , $ExceptionlessClient ) => {
88 return {
99 responseError : function responseError ( rejection ) {
1010 if ( rejection . status === 404 ) {
@@ -21,28 +21,29 @@ angular.module('exceptionless', [])
2121 }
2222 } ;
2323 } ] )
24- . config ( [ '$httpProvider' , '$provide' , '$ExceptionlessClient' , function ( $httpProvider , $provide , $ExceptionlessClient ) {
24+ . config ( [ '$httpProvider' , '$provide' , '$ExceptionlessClient' , ( $httpProvider , $provide , $ExceptionlessClient ) => {
2525 $httpProvider . interceptors . push ( 'exceptionlessHttpInterceptor' ) ;
26- $provide . decorator ( '$exceptionHandler' , [ '$delegate' , function ( $delegate ) {
27- return function ( exception , cause ) {
26+ $provide . decorator ( '$exceptionHandler' , [ '$delegate' , ( $delegate ) => {
27+ return ( exception , cause ) => {
2828 $delegate ( exception , cause ) ;
2929 $ExceptionlessClient . createUnhandledException ( exception , '$exceptionHandler' ) . setMessage ( cause ) . submit ( ) ;
3030 } ;
3131 } ] ) ;
32- $provide . decorator ( '$log' , [ '$delegate' , function ( $delegate ) {
32+ $provide . decorator ( '$log' , [ '$delegate' , ( $delegate ) => {
3333 function decorateRegularCall ( property , logLevel ) {
3434 const previousFn = $delegate [ property ] ;
35- return $delegate [ property ] = function ( ) {
35+ return $delegate [ property ] = ( ... args ) => {
3636 if ( angular . mock ) {
3737 // Needed to support angular-mocks.
3838 $delegate [ property ] . logs = [ ] ;
3939 }
40- previousFn . apply ( null , arguments ) ;
41- if ( arguments [ 0 ] && arguments [ 0 ] . length > 0 ) {
42- $ExceptionlessClient . submitLog ( null , arguments [ 0 ] , logLevel ) ;
40+ previousFn . apply ( null , args ) ;
41+ if ( args [ 0 ] && args [ 0 ] . length > 0 ) {
42+ $ExceptionlessClient . submitLog ( null , args [ 0 ] , logLevel ) ;
4343 }
4444 } ;
4545 }
46+
4647 $delegate . log = decorateRegularCall ( 'log' , 'Trace' ) ;
4748 $delegate . info = decorateRegularCall ( 'info' , 'Info' ) ;
4849 $delegate . warn = decorateRegularCall ( 'warn' , 'Warn' ) ;
@@ -51,8 +52,8 @@ angular.module('exceptionless', [])
5152 return $delegate ;
5253 } ] ) ;
5354 } ] )
54- . run ( [ '$rootScope' , '$ExceptionlessClient' , function ( $rootScope , $ExceptionlessClient ) {
55- $rootScope . $on ( '$routeChangeSuccess' , function ( event , next , current ) {
55+ . run ( [ '$rootScope' , '$ExceptionlessClient' , ( $rootScope , $ExceptionlessClient ) => {
56+ $rootScope . $on ( '$routeChangeSuccess' , ( event , next , current ) => {
5657 if ( ! current ) {
5758 return ;
5859 }
@@ -63,14 +64,14 @@ angular.module('exceptionless', [])
6364 . submit ( ) ;
6465 } ) ;
6566
66- $rootScope . $on ( '$routeChangeError' , function ( event , current , previous , rejection ) {
67+ $rootScope . $on ( '$routeChangeError' , ( event , current , previous , rejection ) => {
6768 $ExceptionlessClient . createUnhandledException ( new Error ( rejection ) , '$routeChangeError' )
6869 . setProperty ( 'current' , current )
6970 . setProperty ( 'previous' , previous )
7071 . submit ( ) ;
7172 } ) ;
7273
73- $rootScope . $on ( '$stateChangeSuccess' , function ( event , toState , toParams , fromState , fromParams ) {
74+ $rootScope . $on ( '$stateChangeSuccess' , ( event , toState , toParams , fromState , fromParams ) => {
7475 if ( ! toState || toState . name === 'otherwise' ) {
7576 return ;
7677 }
@@ -83,7 +84,7 @@ angular.module('exceptionless', [])
8384 . submit ( ) ;
8485 } ) ;
8586
86- $rootScope . $on ( '$stateNotFound' , function ( event , unfoundState , fromState , fromParams ) {
87+ $rootScope . $on ( '$stateNotFound' , ( event , unfoundState , fromState , fromParams ) => {
8788 if ( ! unfoundState ) {
8889 return ;
8990 }
@@ -95,8 +96,8 @@ angular.module('exceptionless', [])
9596 . submit ( ) ;
9697 } ) ;
9798
98- let stateChangeError = '$stateChangeError' ;
99- $rootScope . $on ( stateChangeError , function ( event , toState , toParams , fromState , fromParams , error ) {
99+ const stateChangeError = '$stateChangeError' ;
100+ $rootScope . $on ( stateChangeError , ( event , toState , toParams , fromState , fromParams , error ) => {
100101 if ( ! error ) {
101102 return ;
102103 }
@@ -111,7 +112,7 @@ angular.module('exceptionless', [])
111112 . submit ( ) ;
112113 } ) ;
113114
114- $rootScope . $on ( '$destroy' , function ( ) {
115+ $rootScope . $on ( '$destroy' , ( ) => {
115116 $ExceptionlessClient . config . queue . process ( ) ;
116117 } ) ;
117118 } ] ) ;
0 commit comments