X-Git-Url: https://git.piment-noir.org/?a=blobdiff_plain;ds=sidebyside;f=src%2Fexception%2FOCPPError.ts;h=90817649e9783b519bc506ff53e860b8f4d02123;hb=976d11ec6d2d38a5a82440de79f059638e28cdbd;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..90817649 100644 --- a/src/exception/OCPPError.ts +++ b/src/exception/OCPPError.ts @@ -1,16 +1,21 @@ // Partial Copyright Jerome Benoit. 2021. All Rights Reserved. -import { IncomingRequestCommand, RequestCommand } from '../types/ocpp/Requests'; - -import BaseError from './BaseError'; +import type { JsonType } from '../types/JsonType'; import { ErrorType } from '../types/ocpp/ErrorType'; +import type { IncomingRequestCommand, RequestCommand } from '../types/ocpp/Requests'; +import BaseError from './BaseError'; 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;