From a03b18c4731bfd1173ff67b74a75684d3f6bb470 Mon Sep 17 00:00:00 2001 From: =?utf8?q?J=C3=A9r=C3=B4me=20Benoit?= Date: Fri, 7 Jun 2024 17:49:59 +0200 Subject: [PATCH] refactor: rename Storage.handleDBError -> Storage.handleDBStorageError MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Signed-off-by: Jérôme Benoit --- src/performance/storage/MikroOrmStorage.ts | 10 +++++++--- src/performance/storage/MongoDBStorage.ts | 10 +++++++--- src/performance/storage/Storage.ts | 2 +- 3 files changed, 15 insertions(+), 7 deletions(-) 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, -- 2.34.1