diff --git a/src/utils.ts b/src/utils.ts index 5e2fc36..d95f2f9 100644 --- a/src/utils.ts +++ b/src/utils.ts @@ -8,6 +8,9 @@ export const RESOURCE_TYPE = 'kapeta/resource-type-mongodb'; export const PORT_TYPE = 'mongodb'; export async function createDBURI(provider:ConfigProvider, resourceName: string) { const dbInfo = await provider.getResourceInfo(RESOURCE_TYPE, PORT_TYPE, resourceName); + if (!dbInfo) { + throw new Error(`Resource ${resourceName} not found`); + } const dbName = dbInfo.options && dbInfo.options.dbName ? dbInfo.options.dbName