X-Git-Url: https://git.piment-noir.org/?a=blobdiff_plain;f=src%2Fexception%2FOCPPError.ts;h=e67f3c95f56c38b81a22e1c70a1be191199e610c;hb=982dac64f21b5024d6f68dc73fa53a8240271a75;hp=cfcc4f40c8dacc0c6eefcd07e71706877cbb3c01;hpb=e58068fde9b27e3de6733be24fc7b3dfac37331b;p=e-mobility-charging-stations-simulator.git diff --git a/src/exception/OCPPError.ts b/src/exception/OCPPError.ts index cfcc4f40..e67f3c95 100644 --- a/src/exception/OCPPError.ts +++ b/src/exception/OCPPError.ts @@ -4,13 +4,19 @@ import { IncomingRequestCommand, RequestCommand } from '../types/ocpp/Requests'; import BaseError from './BaseError'; import { ErrorType } from '../types/ocpp/ErrorType'; +import { JsonType } from '../types/JsonType'; export default class OCPPError extends BaseError { - code: ErrorType | IncomingRequestCommand; + code: ErrorType; command?: RequestCommand | IncomingRequestCommand; - details?: Record; + details?: JsonType; - constructor(code: ErrorType | IncomingRequestCommand, message: string, command?: RequestCommand | IncomingRequestCommand, details?: Record) { + constructor( + code: ErrorType, + message: string, + command?: RequestCommand | IncomingRequestCommand, + details?: JsonType + ) { super(message); this.code = code ?? ErrorType.GENERIC_ERROR;