Infisical is the open-source platform for securing secrets, certificates, access, and AI Agents.
TypeScript acmeagentsai-agentscertificate-managementdevsecopsenvironment-variableskubernetesopen-sourcepampkipostgresprivate-caprivileged-access-managementsecret-managementsecret-managersecretssecrets-managementsecuritysecurity-toolsvault
fix: improve project error handling
Daniel Hougaard2b977eeb3348
diff --git a/backend/src/services/project/project-dal.ts b/backend/src/services/project/project-dal.tsindex 4e74253263..e5e4471454 100644--- a/backend/src/services/project/project-dal.ts+++ b/backend/src/services/project/project-dal.ts@@ -191,6 +191,10 @@ export const projectDALFactory = (db: TDbClient) => {return project;} catch (error) {+ if (error instanceof NotFoundError) {+ throw error;+ }+throw new DatabaseError({ error, name: "Find all projects" });}};@@ -240,6 +244,10 @@ export const projectDALFactory = (db: TDbClient) => {return project;} catch (error) {+ if (error instanceof NotFoundError || error instanceof UnauthorizedError) {+ throw error;+ }+throw new DatabaseError({ error, name: "Find project by slug" });}};@@ -260,7 +268,7 @@ export const projectDALFactory = (db: TDbClient) => {}throw new BadRequestError({ message: "Invalid filter type" });} catch (error) {- if (error instanceof BadRequestError) {+ if (error instanceof BadRequestError || error instanceof NotFoundError || error instanceof UnauthorizedError) {throw error;}throw new DatabaseError({ error, name: `Failed to find project by ${filter.type}` });