Initial commit
[e-mobility-charging-stations-simulator.git] / src / charging-station / OcppError.js
1 class 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
11 Error.captureStackTrace ? (Error.captureStackTrace(this, this.constructor)) : (this.stack = (new Error()).stack);
12 }
13 }
14
15 module.exports = OCPPError;