@@ -89,17 +89,20 @@ angular.module('exceptionless', [])
8989 . submit ( ) ;
9090 } ) ;
9191
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 ) {
9394 if ( ! error ) {
9495 return ;
9596 }
9697
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 ( ) ;
103106 } ) ;
104107
105108 $rootScope . $on ( '$destroy' , function ( ) {
0 commit comments