File tree Expand file tree Collapse file tree 1 file changed +1
-5
lines changed Expand file tree Collapse file tree 1 file changed +1
-5
lines changed Original file line number Diff line number Diff line change @@ -33,7 +33,6 @@ export class Timeout extends Promise<never> {
3333 return 'MongoDBTimeout' ;
3434 }
3535
36- private timeoutError : TimeoutError ;
3736 private id ?: NodeJS . Timeout ;
3837
3938 public readonly start : number ;
@@ -55,17 +54,14 @@ export class Timeout extends Promise<never> {
5554 executor ( noop , promiseReject ) ;
5655 } ) ;
5756
58- // NOTE: Construct timeout error at point of Timeout instantiation to preserve stack traces
59- this . timeoutError = new TimeoutError ( `Expired after ${ duration } ms` ) ;
60-
6157 this . duration = duration ;
6258 this . start = Math . trunc ( performance . now ( ) ) ;
6359
6460 if ( this . duration > 0 ) {
6561 this . id = setTimeout ( ( ) => {
6662 this . ended = Math . trunc ( performance . now ( ) ) ;
6763 this . timedOut = true ;
68- reject ( this . timeoutError ) ;
64+ reject ( new TimeoutError ( `Expired after ${ duration } ms` ) ) ;
6965 } , this . duration ) ;
7066 // Ensure we do not keep the Node.js event loop running
7167 if ( typeof this . id . unref === 'function' ) {
You can’t perform that action at this time.
0 commit comments