From: Jérôme Benoit Date: Sun, 17 Apr 2022 19:51:22 +0000 (+0200) Subject: Improve error information at OCPP incoming message handling X-Git-Tag: v1.1.58~2 X-Git-Url: https://git.piment-noir.org/?a=commitdiff_plain;h=c2bc716fae3113f20ac1b339038f566d06ee1e1b;p=e-mobility-charging-stations-simulator.git Improve error information at OCPP incoming message handling Signed-off-by: Jérôme Benoit --- diff --git a/src/charging-station/ChargingStation.ts b/src/charging-station/ChargingStation.ts index b570f74a..9f3ad1ed 100644 --- a/src/charging-station/ChargingStation.ts +++ b/src/charging-station/ChargingStation.ts @@ -1517,7 +1517,9 @@ export default class ChargingStation { } else { throw new OCPPError( ErrorType.PROTOCOL_ERROR, - `Cached request for message id ${messageId} response is not iterable` + `Cached request for message id ${messageId} response is not iterable`, + null, + cachedRequest as unknown as JsonType ); } logger.debug( @@ -1529,7 +1531,9 @@ export default class ChargingStation { // Error throw new OCPPError( ErrorType.INTERNAL_ERROR, - `Response for unknown message id ${messageId}` + `Response for unknown message id ${messageId}`, + null, + commandPayload ); } responseCallback(commandPayload, requestPayload); @@ -1543,7 +1547,9 @@ export default class ChargingStation { } else { throw new OCPPError( ErrorType.PROTOCOL_ERROR, - `Cached request for message id ${messageId} error response is not iterable` + `Cached request for message id ${messageId} error response is not iterable`, + null, + cachedRequest as unknown as JsonType ); } logger.debug( @@ -1555,7 +1561,9 @@ export default class ChargingStation { // Error throw new OCPPError( ErrorType.INTERNAL_ERROR, - `Error response for unknown message id ${messageId}` + `Error response for unknown message id ${messageId}`, + null, + { errorType, errorMessage, errorDetails } ); } rejectCallback(