Cleanups.
[e-mobility-charging-stations-simulator.git] / src / charging-station / OcppError.js
CommitLineData
7dde0b73
JB
1class OCPPError extends Error {
2 constructor(code, message, details) {
3 super(message);
4
5 this.code = code;
6 this.message = message;
7 this.details = details;
8
9 Object.setPrototypeOf(this, OCPPError.prototype); // for instanceof
10
72766a82 11 Error.captureStackTrace ? Error.captureStackTrace(this, this.constructor) : (this.stack = (new Error()).stack);
7dde0b73
JB
12 }
13}
14
15module.exports = OCPPError;