fix: various fixes to files handling and their content caching
[e-mobility-charging-stations-simulator.git] / src / performance / storage / JsonFileStorage.ts
index 50d1a8b925e0b46862c22c41d77b3fc1f9e5d078..2a712a6008f61722ef21dddaac5acd2e3ba14d53 100644 (file)
@@ -4,6 +4,7 @@ import fs from 'node:fs';
 import path from 'node:path';
 
 import { Storage } from './Storage';
+import { BaseError } from '../../exception';
 import { FileType, type Statistics } from '../../types';
 import { AsyncLock, AsyncLockType, Constants, ErrorUtils, Utils } from '../../utils';
 
@@ -79,7 +80,7 @@ export class JsonFileStorage extends Storage {
 
   private checkPerformanceRecordsFile(): void {
     if (!this?.fd) {
-      throw new Error(
+      throw new BaseError(
         `${this.logPrefix} Performance records '${this.dbName}' file descriptor not found`
       );
     }