Apply dependencies update
[e-mobility-charging-stations-simulator.git] / src / performance / storage / Storage.ts
index 266d934177886eec06ca97b19a8ba07db11a5c42..4770fb7520737cf1da7b3c4833761fd9ba9b7344 100644 (file)
@@ -25,10 +25,12 @@ export abstract class Storage {
     table?: string,
     params: HandleErrorParams<EmptyObject> = { throwError: false }
   ): void {
+    const inTableOrCollectionStr =
+      (!Utils.isNullOrUndefined(table) || !table) && ` in table or collection '${table}'`;
     logger.error(
-      `${this.logPrefix} ${this.getDBNameFromStorageType(type)} error '${error.message}'${
-        (!Utils.isNullOrUndefined(table) || !table) && ` in table or collection '${table}'`
-      }: %j`,
+      `${this.logPrefix} ${this.getDBNameFromStorageType(type)} error '${
+        error.message
+      }'${inTableOrCollectionStr}: %j`,
       error
     );
     if (params?.throwError) {