X-Git-Url: https://git.piment-noir.org/?a=blobdiff_plain;ds=sidebyside;f=src%2Fperformance%2Fstorage%2FStorage.ts;h=39d0a1b30250b80fd825351f4d476792ef89a3a6;hb=64c14c99f9902d4e96f2a2cd404e536e0584a629;hp=aee3ae9efbb5ca86b17a8a7ddf3fcd01b7b80684;hpb=89448b6160fe75bd2dc10e409ba6c0988768a154;p=e-mobility-charging-stations-simulator.git diff --git a/src/performance/storage/Storage.ts b/src/performance/storage/Storage.ts index aee3ae9e..39d0a1b3 100644 --- a/src/performance/storage/Storage.ts +++ b/src/performance/storage/Storage.ts @@ -9,7 +9,7 @@ import { type Statistics, StorageType } from '../../types/index.js' -import { logger, setDefaultErrorParams } from '../../utils/index.js' +import { logger } from '../../utils/index.js' export abstract class Storage { protected readonly storageUri: URL @@ -22,13 +22,22 @@ export abstract class Storage { this.logPrefix = logPrefix } - protected handleDBError ( + protected handleDBStorageError ( type: StorageType, error: Error, table?: string, - params: HandleErrorParams = { throwError: false, consoleOut: false } + params: HandleErrorParams = { + throwError: false, + consoleOut: false + } ): void { - setDefaultErrorParams(params, { throwError: false, consoleOut: false }) + params = { + ...{ + throwError: false, + consoleOut: false + }, + ...params + } const inTableOrCollectionStr = table != null && ` in table or collection '${table}'` logger.error( `${this.logPrefix} ${this.getDBNameFromStorageType(type)} error '${