From: Jérôme Benoit Date: Sun, 17 Apr 2022 14:28:31 +0000 (+0200) Subject: Fixlets to OCPP error message format, take 2 X-Git-Tag: v1.1.58~4 X-Git-Url: https://git.piment-noir.org/?a=commitdiff_plain;h=7ec6c5c94175cf4c04937d8e13145cc812b126b5;p=e-mobility-charging-stations-simulator.git Fixlets to OCPP error message format, take 2 Signed-off-by: Jérôme Benoit --- diff --git a/src/charging-station/ChargingStation.ts b/src/charging-station/ChargingStation.ts index c3c75ba0..a187ddd0 100644 --- a/src/charging-station/ChargingStation.ts +++ b/src/charging-station/ChargingStation.ts @@ -1521,16 +1521,15 @@ export default class ChargingStation { ); } logger.debug( - `${this.logPrefix()} << Command '${requestCommandName}' received response payload: ${JSON.stringify( - request - )}` + `${this.logPrefix()} << Command '${ + requestCommandName ?? '' + }' received response payload: ${JSON.stringify(request)}` ); if (!responseCallback) { // Error throw new OCPPError( ErrorType.INTERNAL_ERROR, - `Response for unknown message id ${messageId}`, - requestCommandName + `Response for unknown message id ${messageId}` ); } responseCallback(commandPayload, requestPayload); @@ -1548,16 +1547,15 @@ export default class ChargingStation { ); } logger.debug( - `${this.logPrefix()} << Command '${requestCommandName}' received error payload: ${JSON.stringify( - request - )}` + `${this.logPrefix()} << Command '${ + requestCommandName ?? '' + }' received error payload: ${JSON.stringify(request)}` ); if (!rejectCallback) { // Error throw new OCPPError( ErrorType.INTERNAL_ERROR, - `Error response for unknown message id ${messageId}`, - requestCommandName + `Error response for unknown message id ${messageId}` ); } rejectCallback(