refactor: refine OCPP PDU validation error messages
authorJérôme Benoit <jerome.benoit@piment-noir.org>
Tue, 23 Jul 2024 12:14:26 +0000 (14:14 +0200)
committerJérôme Benoit <jerome.benoit@piment-noir.org>
Tue, 23 Jul 2024 12:14:26 +0000 (14:14 +0200)
Signed-off-by: Jérôme Benoit <jerome.benoit@piment-noir.org>
src/charging-station/ocpp/OCPPRequestService.ts

index 58cb6408681b812cd30e9e74977b985777c9378f..3ae9034d2207e37d812841fed35ebb95e002de92 100644 (file)
@@ -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)
     )