X-Git-Url: https://git.piment-noir.org/?a=blobdiff_plain;f=src%2Fexception%2FOCPPError.ts;h=c5d25ddc23d402070437d511dce6a3ea11156bc3;hb=c3b8313087c651563b66173c2d6dd41034d194f9;hp=e3c127fd22e375921f3303e0f70f2285ea7d6451;hpb=edd134392e237a3242dc2093341df70244c51472;p=e-mobility-charging-stations-simulator.git diff --git a/src/exception/OCPPError.ts b/src/exception/OCPPError.ts index e3c127fd..c5d25ddc 100644 --- a/src/exception/OCPPError.ts +++ b/src/exception/OCPPError.ts @@ -1,11 +1,15 @@ // Partial Copyright Jerome Benoit. 2021-2023. All Rights Reserved. -import type { JsonType } from '../types/JsonType'; -import { ErrorType } from '../types/ocpp/ErrorType'; -import type { IncomingRequestCommand, RequestCommand } from '../types/ocpp/Requests'; -import BaseError from './BaseError'; +import { BaseError } from './internal'; +import { + ErrorType, + type IncomingRequestCommand, + type JsonType, + type RequestCommand, +} from '../types'; +import { Constants } from '../utils'; -export default class OCPPError extends BaseError { +export class OCPPError extends BaseError { code: ErrorType; command?: RequestCommand | IncomingRequestCommand; details?: JsonType; @@ -20,6 +24,6 @@ export default class OCPPError extends BaseError { this.code = code ?? ErrorType.GENERIC_ERROR; this.command = command; - this.details = details ?? {}; + this.details = details ?? Constants.EMPTY_FREEZED_OBJECT; } }