Skip to content

Commit 49babb2

Browse files
W-A-Jamesljhaywar
authored andcommitted
feat(NODE-3410): added MongoRuntimeError (#2892)
1 parent 1bee7ab commit 49babb2

File tree

1 file changed

+20
-0
lines changed

1 file changed

+20
-0
lines changed

src/error.ts

+20
Original file line numberDiff line numberDiff line change
@@ -178,6 +178,26 @@ export class MongoDriverError extends MongoError {
178178
}
179179
}
180180

181+
/**
182+
* An error generated when the driver encounters unexpected input
183+
* or reaches an unexpected/invalid internal state
184+
*
185+
* @privateRemarks
186+
* Should **never** be directly instantiated.
187+
*
188+
* @public
189+
* @category Error
190+
*/
191+
export class MongoRuntimeError extends MongoDriverError {
192+
protected constructor(message: string) {
193+
super(message);
194+
}
195+
196+
get name(): string {
197+
return 'MongoRuntimeError';
198+
}
199+
}
200+
181201
/** @internal */
182202
const kBeforeHandshake = Symbol('beforeHandshake');
183203
export function isNetworkErrorBeforeHandshake(err: MongoNetworkError): boolean {

0 commit comments

Comments
 (0)