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() {
20472047 assert . isFalse ( Raven . _handleStackInfo . called ) ;
20482048 } ) ;
20492049
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+
20502065 it ( 'should not throw an error if not configured' , function ( ) {
20512066 this . sinon . stub ( Raven , 'isSetup' ) . returns ( false ) ;
20522067 this . sinon . stub ( Raven , '_handleStackInfo' ) ;
You can’t perform that action at this time.
0 commit comments