Skip to content

Commit

Permalink
feat(NODE-3410): added MongoRuntimeError (#2892)
Browse files Browse the repository at this point in the history
  • Loading branch information
W-A-James authored Jul 8, 2021
1 parent c145c91 commit ee903cb
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions src/error.ts
Original file line number Diff line number Diff line change
Expand Up @@ -178,6 +178,26 @@ export class MongoDriverError extends MongoError {
}
}

/**
* An error generated when the driver encounters unexpected input
* or reaches an unexpected/invalid internal state
*
* @privateRemarks
* Should **never** be directly instantiated.
*
* @public
* @category Error
*/
export class MongoRuntimeError extends MongoDriverError {
protected constructor(message: string) {
super(message);
}

get name(): string {
return 'MongoRuntimeError';
}
}

/** @internal */
const kBeforeHandshake = Symbol('beforeHandshake');
export function isNetworkErrorBeforeHandshake(err: MongoNetworkError): boolean {
Expand Down

0 comments on commit ee903cb

Please sign in to comment.