X-Git-Url: https://git.piment-noir.org/?a=blobdiff_plain;f=src%2Fexception%2FOCPPError.ts;h=f624d7e79704026eb60925f88ba3ddd0ae56de97;hb=6501eda9e69fff639911308b3f2de26593ae18c9;hp=3b23cc3b0d0c18a650a203042810750bd1e89b22;hpb=2896e06dc8d72adf7150b23c941079f622f6f37c;p=e-mobility-charging-stations-simulator.git diff --git a/src/exception/OCPPError.ts b/src/exception/OCPPError.ts index 3b23cc3b..f624d7e7 100644 --- a/src/exception/OCPPError.ts +++ b/src/exception/OCPPError.ts @@ -1,12 +1,13 @@ // Partial Copyright Jerome Benoit. 2021-2023. All Rights Reserved. -import { BaseError } from './internal'; +import { BaseError } from './BaseError'; import { ErrorType, type IncomingRequestCommand, type JsonType, type RequestCommand, } from '../types'; +import { Constants } from '../utils'; export class OCPPError extends BaseError { code: ErrorType; @@ -17,12 +18,12 @@ export class OCPPError extends BaseError { code: ErrorType, message: string, command?: RequestCommand | IncomingRequestCommand, - details?: JsonType + details?: JsonType, ) { super(message); this.code = code ?? ErrorType.GENERIC_ERROR; this.command = command; - this.details = details ?? {}; + this.details = details ?? Constants.EMPTY_FROZEN_OBJECT; } }