File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -112,6 +112,20 @@ describe('doTry', () => {
112112 assert . strictEqual ( warnMessages . length , 1 ) ;
113113 assert . deepStrictEqual ( warnMessages [ 0 ] , [ '[SQLite Explorer]' , 'string error' ] ) ;
114114 } ) ;
115+
116+ it ( 'should return undefined and log warning on null error' , ( ) => {
117+ const result = doTry ( ( ) => { throw null ; } ) ;
118+ assert . strictEqual ( result , undefined ) ;
119+ assert . strictEqual ( warnMessages . length , 1 ) ;
120+ assert . deepStrictEqual ( warnMessages [ 0 ] , [ '[SQLite Explorer]' , 'null' ] ) ;
121+ } ) ;
122+
123+ it ( 'should return undefined and log warning on non-error object' , ( ) => {
124+ const result = doTry ( ( ) => { throw { toString : ( ) => 'custom object error' } ; } ) ;
125+ assert . strictEqual ( result , undefined ) ;
126+ assert . strictEqual ( warnMessages . length , 1 ) ;
127+ assert . deepStrictEqual ( warnMessages [ 0 ] , [ '[SQLite Explorer]' , 'custom object error' ] ) ;
128+ } ) ;
115129} ) ;
116130
117131describe ( 'uiKindToString' , ( ) => {
You can’t perform that action at this time.
0 commit comments