From: Jérôme Benoit Date: Tue, 13 Sep 2022 17:36:14 +0000 (+0200) Subject: Comment some dubious OCPPError usage X-Git-Tag: v1.1.74~41 X-Git-Url: https://git.piment-noir.org/?a=commitdiff_plain;h=e909d2a71e82122e970db9d6f262bd1415a3bb20;p=e-mobility-charging-stations-simulator.git Comment some dubious OCPPError usage Signed-off-by: Jérôme Benoit --- 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',