Skip to content

Commit ce6462e

Browse files
committed
fix(errors::UnexpectedCloseError): add Error
1 parent 36f731e commit ce6462e

File tree

1 file changed

+11
-0
lines changed
  • packages/mongodb-memory-server-core/src/util

1 file changed

+11
-0
lines changed

packages/mongodb-memory-server-core/src/util/errors.ts

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -170,5 +170,16 @@ export class StdoutInstanceError extends Error {
170170
}
171171
}
172172

173+
/**
174+
* Error for when the instance closes with non-0 (or non-12) codes or signals
175+
*/
176+
export class UnexpectedCloseError extends Error {
177+
constructor(code: number | null, signal: string | null) {
178+
super();
179+
180+
this.message = `Instance closed unexpectedly with code "${code}" and signal "${signal}"`;
181+
}
182+
}
183+
173184
/* Custom Generic Error class for MMS */
174185
export class GenericMMSError extends Error {}

0 commit comments

Comments
 (0)