From: Jérôme Benoit Date: Sun, 17 Apr 2022 14:05:41 +0000 (+0200) Subject: Fixlets to OCPP error message format X-Git-Tag: v1.1.58~5 X-Git-Url: https://git.piment-noir.org/?a=commitdiff_plain;h=ac54a9bbb3fee0a1168f982b2e1e37856a61ef2c;p=e-mobility-charging-stations-simulator.git Fixlets to OCPP error message format Signed-off-by: Jérôme Benoit --- diff --git a/src/charging-station/ChargingStation.ts b/src/charging-station/ChargingStation.ts index d2d509f0..c3c75ba0 100644 --- a/src/charging-station/ChargingStation.ts +++ b/src/charging-station/ChargingStation.ts @@ -1517,8 +1517,7 @@ export default class ChargingStation { } else { throw new OCPPError( ErrorType.PROTOCOL_ERROR, - `Cached request for message id ${messageId} response is not iterable`, - requestCommandName + `Cached request for message id ${messageId} response is not iterable` ); } logger.debug( @@ -1573,12 +1572,9 @@ export default class ChargingStation { throw new OCPPError(ErrorType.PROTOCOL_ERROR, errMsg); } } else { - throw new OCPPError( - ErrorType.PROTOCOL_ERROR, - 'Incoming message is not iterable', - Utils.isString(commandName) ? commandName : requestCommandName, - { payload: request } - ); + throw new OCPPError(ErrorType.PROTOCOL_ERROR, 'Incoming message is not iterable', null, { + payload: request, + }); } } catch (error) { // Log @@ -1594,7 +1590,7 @@ export default class ChargingStation { (await this.ocppRequestService.sendError( messageId, error as OCPPError, - Utils.isString(commandName) ? commandName : requestCommandName + Utils.isString(commandName) ? commandName : requestCommandName ?? null )); } }