From: Jérôme Benoit Date: Thu, 15 Sep 2022 08:40:40 +0000 (+0200) Subject: Fix error handling at OCPP message sending X-Git-Tag: v1.1.74~38 X-Git-Url: https://git.piment-noir.org/?a=commitdiff_plain;h=07561812b72072b6d9f20997be86a42ee88e15a2;p=e-mobility-charging-stations-simulator.git Fix error handling at OCPP message sending Signed-off-by: Jérôme Benoit --- diff --git a/src/charging-station/ocpp/OCPPRequestService.ts b/src/charging-station/ocpp/OCPPRequestService.ts index 653679e9..921945e8 100644 --- a/src/charging-station/ocpp/OCPPRequestService.ts +++ b/src/charging-station/ocpp/OCPPRequestService.ts @@ -71,7 +71,7 @@ export default abstract class OCPPRequestService { ); } catch (error) { this.handleSendMessageError(chargingStation, commandName, error as Error, { - throwError: false, + throwError: true, }); } } @@ -116,9 +116,7 @@ export default abstract class OCPPRequestService { params ); } catch (error) { - this.handleSendMessageError(chargingStation, commandName, error as Error, { - throwError: false, - }); + this.handleSendMessageError(chargingStation, commandName, error as Error); } } @@ -364,10 +362,10 @@ export default abstract class OCPPRequestService { chargingStation: ChargingStation, commandName: RequestCommand | IncomingRequestCommand, error: Error, - params: HandleErrorParams = { throwError: true } + params: HandleErrorParams = { throwError: false } ): void { logger.error(`${chargingStation.logPrefix()} Request command '${commandName}' error:`, error); - if (params?.throwError) { + if (params?.throwError === true) { throw error; } }