File tree Expand file tree Collapse file tree 1 file changed +15
-0
lines changed Expand file tree Collapse file tree 1 file changed +15
-0
lines changed Original file line number Diff line number Diff line change @@ -2047,6 +2047,21 @@ describe('Raven (public API)', function() {
2047
2047
assert . isFalse ( Raven . _handleStackInfo . called ) ;
2048
2048
} ) ;
2049
2049
2050
+ it ( 'should capture custom errors that extend the Error prototype' , function ( ) {
2051
+ function NotImplementedError ( message ) {
2052
+ this . name = "NotImplementedError" ;
2053
+ this . message = message || "" ;
2054
+ }
2055
+ NotImplementedError . prototype = Error . prototype ;
2056
+
2057
+ this . sinon . stub ( Raven , 'isSetup' ) . returns ( true ) ;
2058
+ this . sinon . stub ( Raven , '_handleStackInfo' ) ;
2059
+
2060
+ Raven . captureException ( new NotImplementedError ( 'Bzzap' ) ) ;
2061
+
2062
+ assert . isTrue ( Raven . _handleStackInfo . calledOnce ) ;
2063
+ } ) ;
2064
+
2050
2065
it ( 'should not throw an error if not configured' , function ( ) {
2051
2066
this . sinon . stub ( Raven , 'isSetup' ) . returns ( false ) ;
2052
2067
this . sinon . stub ( Raven , '_handleStackInfo' ) ;
You can’t perform that action at this time.
0 commit comments