From: Jérôme Benoit Date: Tue, 23 Jul 2024 12:14:26 +0000 (+0200) Subject: refactor: refine OCPP PDU validation error messages X-Git-Tag: ocpp-server@v1.5.0~12 X-Git-Url: https://git.piment-noir.org/?a=commitdiff_plain;h=5827ccc27d6c46f82df4e42a5707cfa19b550442;p=e-mobility-charging-stations-simulator.git refactor: refine OCPP PDU validation error messages Signed-off-by: Jérôme Benoit --- diff --git a/src/charging-station/ocpp/OCPPRequestService.ts b/src/charging-station/ocpp/OCPPRequestService.ts index 58cb6408..3ae9034d 100644 --- a/src/charging-station/ocpp/OCPPRequestService.ts +++ b/src/charging-station/ocpp/OCPPRequestService.ts @@ -231,13 +231,13 @@ export abstract class OCPPRequestService { return true } logger.error( - `${chargingStation.logPrefix()} ${moduleName}.validateIncomingRequestResponsePayload: Command '${commandName}' response PDU is invalid: %j`, + `${chargingStation.logPrefix()} ${moduleName}.validateIncomingRequestResponsePayload: Command '${commandName}' incoming request response PDU is invalid: %j`, validate?.errors ) // OCPPError usage here is debatable: it's an error in the OCPP stack but not targeted to sendError(). throw new OCPPError( ajvErrorsToErrorType(validate?.errors), - 'Response PDU is invalid', + 'Incoming request response PDU is invalid', commandName, JSON.stringify(validate?.errors, undefined, 2) )