MCPcopy
hub / github.com/mongodb/node-mongodb-native / throwIfExpired

Method throwIfExpired

src/timeout.ts:104–112  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

102 }
103
104 throwIfExpired(): void {
105 if (this.timedOut) {
106 // This method is invoked when someone wants to throw immediately instead of await the result of this promise
107 // Since they won't be handling the rejection from the promise (because we're about to throw here)
108 // attach handling to prevent this from bubbling up to Node.js
109 this.then(undefined, squashError);
110 throw new TimeoutError('Timed out', { duration: this.duration });
111 }
112 }
113
114 public static expires(duration: number, unref?: true): Timeout {
115 return new Timeout(undefined, { duration, unref });

Callers 3

checkOutMethod · 0.80
onDataFunction · 0.80
selectServerMethod · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected