From dc9226673d5ecd265b970af3f748838017bba6fb Mon Sep 17 00:00:00 2001 From: =?utf8?q?J=C3=A9r=C3=B4me=20Benoit?= Date: Wed, 14 Sep 2022 18:40:19 +0200 Subject: [PATCH] Do not propagate thrown error at sendError() 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/OCPPRequestService.ts | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) 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, -- 2.34.1