6780b60bcc032bc8f3470069b0150836c4d42dcf
1 import { ErrorType
} from
'../types/ocpp/ErrorType';
3 export default class OCPPError
extends Error {
7 constructor(code
: string, message
: string, details
?: any) {
10 this.code
= code
?? ErrorType
.GENERIC_ERROR
;
11 this.message
= message
?? '';
12 this.details
= details
?? {};
14 Object.setPrototypeOf(this, OCPPError
.prototype
); // For instanceof
16 Error.captureStackTrace
? Error.captureStackTrace(this, this.constructor
) : (this.stack
= (new Error()).stack
);