2bef07d4f2770b91e047738fe3ed48e45e5f5c07
1 import Constants
from '../utils/Constants.js';
3 export default class OCPPError
extends Error
{
4 constructor(code
, message
, details
) {
7 this.code
= code
|| Constants
.OCPP_ERROR_GENERIC_ERROR
;
8 this.message
= message
|| '';
9 this.details
= details
|| {};
11 Object
.setPrototypeOf(this, OCPPError
.prototype); // for instanceof
13 Error
.captureStackTrace
? Error
.captureStackTrace(this, this.constructor) : (this.stack
= (new Error()).stack
);