From: Jérôme Benoit Date: Fri, 7 Jun 2024 15:49:59 +0000 (+0200) Subject: refactor: rename Storage.handleDBError -> Storage.handleDBStorageError X-Git-Tag: v1.3.5~13 X-Git-Url: https://git.piment-noir.org/?a=commitdiff_plain;h=a03b18c4731bfd1173ff67b74a75684d3f6bb470;p=e-mobility-charging-stations-simulator.git refactor: rename Storage.handleDBError -> Storage.handleDBStorageError Signed-off-by: Jérôme Benoit --- diff --git a/src/performance/storage/MikroOrmStorage.ts b/src/performance/storage/MikroOrmStorage.ts index 7b4545bd..7269ce76 100644 --- a/src/performance/storage/MikroOrmStorage.ts +++ b/src/performance/storage/MikroOrmStorage.ts @@ -28,7 +28,11 @@ export class MikroOrmStorage extends Storage { })) } satisfies PerformanceRecord) } catch (error) { - this.handleDBError(this.storageType, error as Error, Constants.PERFORMANCE_RECORDS_TABLE) + this.handleDBStorageError( + this.storageType, + error as Error, + Constants.PERFORMANCE_RECORDS_TABLE + ) } } @@ -46,7 +50,7 @@ export class MikroOrmStorage extends Storage { } } } catch (error) { - this.handleDBError(this.storageType, error as Error) + this.handleDBStorageError(this.storageType, error as Error) } } @@ -58,7 +62,7 @@ export class MikroOrmStorage extends Storage { delete this.orm } } catch (error) { - this.handleDBError(this.storageType, error as Error) + this.handleDBStorageError(this.storageType, error as Error) } } diff --git a/src/performance/storage/MongoDBStorage.ts b/src/performance/storage/MongoDBStorage.ts index 3d99284f..982e55bf 100644 --- a/src/performance/storage/MongoDBStorage.ts +++ b/src/performance/storage/MongoDBStorage.ts @@ -29,7 +29,11 @@ export class MongoDBStorage extends Storage { upsert: true }) } catch (error) { - this.handleDBError(StorageType.MONGO_DB, error as Error, Constants.PERFORMANCE_RECORDS_TABLE) + this.handleDBStorageError( + StorageType.MONGO_DB, + error as Error, + Constants.PERFORMANCE_RECORDS_TABLE + ) } } @@ -40,7 +44,7 @@ export class MongoDBStorage extends Storage { this.connected = true } } catch (error) { - this.handleDBError(StorageType.MONGO_DB, error as Error) + this.handleDBStorageError(StorageType.MONGO_DB, error as Error) } } @@ -52,7 +56,7 @@ export class MongoDBStorage extends Storage { this.connected = false } } catch (error) { - this.handleDBError(StorageType.MONGO_DB, error as Error) + this.handleDBStorageError(StorageType.MONGO_DB, error as Error) } } diff --git a/src/performance/storage/Storage.ts b/src/performance/storage/Storage.ts index bdf7acb1..ccdbb3f8 100644 --- a/src/performance/storage/Storage.ts +++ b/src/performance/storage/Storage.ts @@ -22,7 +22,7 @@ export abstract class Storage { this.logPrefix = logPrefix } - protected handleDBError ( + protected handleDBStorageError ( type: StorageType, error: Error, table?: string,