12 lines
258 B
JavaScript
12 lines
258 B
JavaScript
|
class customError extends Error {
|
||
|
constructor(message, code) {
|
||
|
super(message)
|
||
|
if (Error.captureStackTrace) {
|
||
|
Error.captureStackTrace(this, customError);
|
||
|
}
|
||
|
|
||
|
this.code = code;
|
||
|
}
|
||
|
}
|
||
|
|
||
|
export default customError;
|