From: Jérôme Benoit Date: Sat, 23 Jul 2022 09:35:01 +0000 (+0200) Subject: Improve incoming request handling error log X-Git-Tag: v1.1.64~6 X-Git-Url: https://git.piment-noir.org/?a=commitdiff_plain;h=247659af5f1e5377f7df1de89bfc1241158ed47c;p=e-mobility-charging-stations-simulator.git Improve incoming request handling error log Signed-off-by: Jérôme Benoit --- 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(