File tree 1 file changed +1
-5
lines changed 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> {
33
33
return 'MongoDBTimeout' ;
34
34
}
35
35
36
- private timeoutError : TimeoutError ;
37
36
private id ?: NodeJS . Timeout ;
38
37
39
38
public readonly start : number ;
@@ -55,17 +54,14 @@ export class Timeout extends Promise<never> {
55
54
executor ( noop , promiseReject ) ;
56
55
} ) ;
57
56
58
- // NOTE: Construct timeout error at point of Timeout instantiation to preserve stack traces
59
- this . timeoutError = new TimeoutError ( `Expired after ${ duration } ms` ) ;
60
-
61
57
this . duration = duration ;
62
58
this . start = Math . trunc ( performance . now ( ) ) ;
63
59
64
60
if ( this . duration > 0 ) {
65
61
this . id = setTimeout ( ( ) => {
66
62
this . ended = Math . trunc ( performance . now ( ) ) ;
67
63
this . timedOut = true ;
68
- reject ( this . timeoutError ) ;
64
+ reject ( new TimeoutError ( `Expired after ${ duration } ms` ) ) ;
69
65
} , this . duration ) ;
70
66
// Ensure we do not keep the Node.js event loop running
71
67
if ( typeof this . id . unref === 'function' ) {
You can’t perform that action at this time.
0 commit comments