From 7ec6c5c94175cf4c04937d8e13145cc812b126b5 Mon Sep 17 00:00:00 2001 From: =?utf8?q?J=C3=A9r=C3=B4me=20Benoit?= Date: Sun, 17 Apr 2022 16:28:31 +0200 Subject: [PATCH] Fixlets to OCPP error message format, take 2 MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Signed-off-by: Jérôme Benoit --- src/charging-station/ChargingStation.ts | 18 ++++++++---------- 1 file changed, 8 insertions(+), 10 deletions(-) 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( -- 2.34.1