refactor: improve error logging
authorJérôme Benoit <jerome.benoit@sap.com>
Tue, 23 May 2023 08:34:08 +0000 (10:34 +0200)
committerJérôme Benoit <jerome.benoit@sap.com>
Tue, 23 May 2023 08:34:08 +0000 (10:34 +0200)
Signed-off-by: Jérôme Benoit <jerome.benoit@sap.com>
src/charging-station/ChargingStation.ts

index 0851c41abf6308a99774cfb4bc28b29371679c0d..35d40ecec3bc14dba84bb1c2133eec747bff5a19 100644 (file)
@@ -2180,7 +2180,9 @@ export class ChargingStation {
     if (Utils.isNotEmptyString(configuredSupervisionUrl)) {
       return new URL(configuredSupervisionUrl);
     }
-    throw new BaseError('No supervision urls configured');
+    const errorMsg = 'No supervision url configured';
+    logger.error(`${this.logPrefix()} ${errorMsg}`);
+    throw new BaseError(`${errorMsg}`);
   }
 
   private stopHeartbeat(): void {