From 247659af5f1e5377f7df1de89bfc1241158ed47c Mon Sep 17 00:00:00 2001 From: =?utf8?q?J=C3=A9r=C3=B4me=20Benoit?= Date: Sat, 23 Jul 2022 11:35:01 +0200 Subject: [PATCH] Improve incoming request handling error log 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 | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/src/charging-station/ChargingStation.ts b/src/charging-station/ChargingStation.ts index 63574b5c..8c20993c 100644 --- a/src/charging-station/ChargingStation.ts +++ b/src/charging-station/ChargingStation.ts @@ -1450,12 +1450,22 @@ export default class ChargingStation { } catch (error) { // Log logger.error( - '%s Incoming OCPP message %j matching cached request %j processing error %j', + "%s Incoming OCPP '%s' message '%j' matching cached request '%j' processing error: %j", this.logPrefix(), + commandName ?? requestCommandName ?? null, data.toString(), this.requests.get(messageId), error ); + if (!(error instanceof OCPPError)) { + logger.warn( + "%s Error thrown at incoming OCPP '%s' message '%j' handling is not an OCPPError: %j", + this.logPrefix(), + commandName ?? requestCommandName ?? null, + data.toString(), + error + ); + } // Send error messageType === MessageType.CALL_MESSAGE && (await this.ocppRequestService.sendError( -- 2.34.1