From: Jérôme Benoit Date: Wed, 14 Sep 2022 16:40:19 +0000 (+0200) Subject: Do not propagate thrown error at sendError() usage X-Git-Tag: v1.1.74~39 X-Git-Url: https://git.piment-noir.org/?a=commitdiff_plain;h=dc9226673d5ecd265b970af3f748838017bba6fb;p=e-mobility-charging-stations-simulator.git Do not propagate thrown error at sendError() usage Signed-off-by: Jérôme Benoit --- diff --git a/src/charging-station/ocpp/OCPPRequestService.ts b/src/charging-station/ocpp/OCPPRequestService.ts index 625e69f9..653679e9 100644 --- a/src/charging-station/ocpp/OCPPRequestService.ts +++ b/src/charging-station/ocpp/OCPPRequestService.ts @@ -70,7 +70,9 @@ export default abstract class OCPPRequestService { commandName ); } catch (error) { - this.handleRequestError(chargingStation, commandName, error as Error); + this.handleSendMessageError(chargingStation, commandName, error as Error, { + throwError: false, + }); } } @@ -90,7 +92,7 @@ export default abstract class OCPPRequestService { commandName ); } catch (error) { - this.handleRequestError(chargingStation, commandName, error as Error); + this.handleSendMessageError(chargingStation, commandName, error as Error); } } @@ -114,7 +116,9 @@ export default abstract class OCPPRequestService { params ); } catch (error) { - this.handleRequestError(chargingStation, commandName, error as Error, { throwError: false }); + this.handleSendMessageError(chargingStation, commandName, error as Error, { + throwError: false, + }); } } @@ -356,7 +360,7 @@ export default abstract class OCPPRequestService { } } - private handleRequestError( + private handleSendMessageError( chargingStation: ChargingStation, commandName: RequestCommand | IncomingRequestCommand, error: Error,