X-Git-Url: https://git.piment-noir.org/?a=blobdiff_plain;f=src%2Fcharging-station%2FOcppError.js;h=2bef07d4f2770b91e047738fe3ed48e45e5f5c07;hb=38c8fd6c87bc4afde1e52dbd22c3ed0a1918a6fa;hp=df9cc425288a18fd504c96b5ee9d20e25f947ca8;hpb=3f40bc9c40beaa5d90c5e05997c6bc0fdda21bae;p=e-mobility-charging-stations-simulator.git diff --git a/src/charging-station/OcppError.js b/src/charging-station/OcppError.js index df9cc425..2bef07d4 100644 --- a/src/charging-station/OcppError.js +++ b/src/charging-station/OcppError.js @@ -1,10 +1,12 @@ +import Constants from '../utils/Constants.js'; + export default class OCPPError extends Error { constructor(code, message, details) { super(message); - this.code = code; - this.message = message; - this.details = details; + this.code = code || Constants.OCPP_ERROR_GENERIC_ERROR; + this.message = message || ''; + this.details = details || {}; Object.setPrototypeOf(this, OCPPError.prototype); // for instanceof