fix: refine CS registration error message
authorJérôme Benoit <jerome.benoit@sap.com>
Sat, 11 Nov 2023 09:48:20 +0000 (10:48 +0100)
committerJérôme Benoit <jerome.benoit@sap.com>
Sat, 11 Nov 2023 09:48:20 +0000 (10:48 +0100)
Signed-off-by: Jérôme Benoit <jerome.benoit@sap.com>
src/charging-station/ChargingStation.ts

index 0dce59fbea9ea341139a61e40033b77823181791..4525b8b7a45736e0e791ca43fcff613eb6051a8a 100644 (file)
@@ -1735,9 +1735,9 @@ export class ChargingStation extends EventEmitter {
       logger.info(
         `${this.logPrefix()} Connection to OCPP server through ${this.wsConnectionUrl.toString()} succeeded`,
       );
+      let registrationRetryCount = 0;
       if (this.isRegistered() === false) {
         // Send BootNotification
-        let registrationRetryCount = 0;
         do {
           this.bootNotificationResponse = await this.ocppRequestService.requestHandler<
             BootNotificationRequest,
@@ -1767,7 +1767,7 @@ export class ChargingStation extends EventEmitter {
         }
       } else {
         logger.error(
-          `${this.logPrefix()} Registration failure: max retries reached or retry disabled (${this
+          `${this.logPrefix()} Registration failure: maximum retries reached (${registrationRetryCount}) or retry disabled (${this
             .stationInfo?.registrationMaxRetries})`,
         );
       }