refactor: remove unneeded encapsulation in arrow function
authorJérôme Benoit <jerome.benoit@sap.com>
Mon, 20 Nov 2023 10:41:40 +0000 (11:41 +0100)
committerJérôme Benoit <jerome.benoit@sap.com>
Mon, 20 Nov 2023 10:41:40 +0000 (11:41 +0100)
Signed-off-by: Jérôme Benoit <jerome.benoit@sap.com>
src/charging-station/Bootstrap.ts
src/charging-station/ocpp/OCPPRequestService.ts

index 05bd7053033250988e3b9dc66dab275a16ac5f34..003b093a3579c02d094addc7f2210e88d14f789b 100644 (file)
@@ -228,9 +228,7 @@ export class Bootstrap extends EventEmitter {
         .then(() => {
           resolve('Charging stations stopped');
         })
-        .catch((error) => {
-          reject(error);
-        })
+        .catch(reject)
         .finally(() => {
           clearTimeout(waitTimeout);
         });
index 25305ca1ebaeb0885cead2bdad12a2fae2551e0c..c24742d771c636c9cb7c33271770f3ee96a09e77 100644 (file)
@@ -344,9 +344,7 @@ export abstract class OCPPRequestService {
             .then(() => {
               resolve(payload);
             })
-            .catch((error) => {
-              reject(error);
-            })
+            .catch(reject)
             .finally(() => {
               chargingStation.requests.delete(messageId);
             });