From e909d2a71e82122e970db9d6f262bd1415a3bb20 Mon Sep 17 00:00:00 2001 From: =?utf8?q?J=C3=A9r=C3=B4me=20Benoit?= Date: Tue, 13 Sep 2022 19:36:14 +0200 Subject: [PATCH] Comment some dubious OCPPError usage MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Signed-off-by: Jérôme Benoit --- src/charging-station/ocpp/1.6/OCPP16RequestService.ts | 2 ++ src/charging-station/ocpp/OCPPRequestService.ts | 1 + 2 files changed, 3 insertions(+) diff --git a/src/charging-station/ocpp/1.6/OCPP16RequestService.ts b/src/charging-station/ocpp/1.6/OCPP16RequestService.ts index 699a413d..e0628496 100644 --- a/src/charging-station/ocpp/1.6/OCPP16RequestService.ts +++ b/src/charging-station/ocpp/1.6/OCPP16RequestService.ts @@ -165,6 +165,7 @@ export default class OCPP16RequestService extends OCPPRequestService { params )) as unknown as ResponseType; } + // OCPPError usage here is debatable: it's an error in the OCPP stack but not targeted to sendError(). throw new OCPPError( ErrorType.NOT_SUPPORTED, `Unsupported OCPP command '${commandName}'`, @@ -269,6 +270,7 @@ export default class OCPP16RequestService extends OCPPRequestService { }), } as unknown as Request; default: + // OCPPError usage here is debatable: it's an error in the OCPP stack but not targeted to sendError(). throw new OCPPError( ErrorType.NOT_SUPPORTED, // eslint-disable-next-line @typescript-eslint/restrict-template-expressions diff --git a/src/charging-station/ocpp/OCPPRequestService.ts b/src/charging-station/ocpp/OCPPRequestService.ts index 7077a28b..625e69f9 100644 --- a/src/charging-station/ocpp/OCPPRequestService.ts +++ b/src/charging-station/ocpp/OCPPRequestService.ts @@ -135,6 +135,7 @@ export default abstract class OCPPRequestService { `${chargingStation.logPrefix()} ${moduleName}.validateRequestPayload: Request 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( OCPPServiceUtils.ajvErrorsToErrorType(validate.errors), 'Request PDU is invalid', -- 2.34.1