@@ -89,17 +89,20 @@ angular.module('exceptionless', [])
89
89
. submit ( ) ;
90
90
} ) ;
91
91
92
- $rootScope . $on ( '$stateChangeError' , function ( event , toState , toParams , fromState , fromParams , error ) {
92
+ let stateChangeError = '$stateChangeError' ;
93
+ $rootScope . $on ( stateChangeError , function ( event , toState , toParams , fromState , fromParams , error ) {
93
94
if ( ! error ) {
94
95
return ;
95
96
}
96
97
97
- $ExceptionlessClient . createUnhandledException ( error , '$stateChangeError' )
98
- . setProperty ( 'toState' , toState )
99
- . setProperty ( 'toParams' , toParams )
100
- . setProperty ( 'fromState' , fromState )
101
- . setProperty ( 'fromParams' , fromParams )
102
- . submit ( ) ;
98
+ let builder = error && error . status === 404 ? $ExceptionlessClient . createNotFound ( error . config . url ) : $ExceptionlessClient . createUnhandledException ( error , stateChangeError ) ;
99
+ builder . setSource ( stateChangeError )
100
+ . setMessage ( error && error . statusText )
101
+ . setProperty ( 'toState' , toState )
102
+ . setProperty ( 'toParams' , toParams )
103
+ . setProperty ( 'fromState' , fromState )
104
+ . setProperty ( 'fromParams' , fromParams )
105
+ . submit ( ) ;
103
106
} ) ;
104
107
105
108
$rootScope . $on ( '$destroy' , function ( ) {
0 commit comments