// Copyright Jerome Benoit. 2021-2023. All Rights Reserved.
+import { JsonFileStorage } from './JsonFileStorage';
+import { MikroOrmStorage } from './MikroOrmStorage';
+import { MongoDBStorage } from './MongoDBStorage';
+import type { Storage } from './Storage';
+import { BaseError } from '../../exception';
import { StorageType } from '../../types';
-import { JsonFileStorage, MikroOrmStorage, MongoDBStorage, type Storage } from '../internal';
export class StorageFactory {
private constructor() {
// storageInstance = new MikroOrmStorage(connectionUri, logPrefix, type);
// break;
default:
- throw new Error(`${logPrefix} Unknown storage type: ${type}`);
+ throw new BaseError(`${logPrefix} Unknown storage type: ${type}`);
}
return storageInstance;
}