From: Jérôme Benoit Date: Mon, 20 Nov 2023 10:41:40 +0000 (+0100) Subject: refactor: remove unneeded encapsulation in arrow function X-Git-Tag: v1.2.26~27 X-Git-Url: https://git.piment-noir.org/?a=commitdiff_plain;h=b7ee97c15b5c634db6d1aa05f8c52dc2e25715fd;p=e-mobility-charging-stations-simulator.git refactor: remove unneeded encapsulation in arrow function Signed-off-by: Jérôme Benoit --- diff --git a/src/charging-station/Bootstrap.ts b/src/charging-station/Bootstrap.ts index 05bd7053..003b093a 100644 --- a/src/charging-station/Bootstrap.ts +++ b/src/charging-station/Bootstrap.ts @@ -228,9 +228,7 @@ export class Bootstrap extends EventEmitter { .then(() => { resolve('Charging stations stopped'); }) - .catch((error) => { - reject(error); - }) + .catch(reject) .finally(() => { clearTimeout(waitTimeout); }); diff --git a/src/charging-station/ocpp/OCPPRequestService.ts b/src/charging-station/ocpp/OCPPRequestService.ts index 25305ca1..c24742d7 100644 --- a/src/charging-station/ocpp/OCPPRequestService.ts +++ b/src/charging-station/ocpp/OCPPRequestService.ts @@ -344,9 +344,7 @@ export abstract class OCPPRequestService { .then(() => { resolve(payload); }) - .catch((error) => { - reject(error); - }) + .catch(reject) .finally(() => { chargingStation.requests.delete(messageId); });