mirror of
https://github.com/awatertrevi/infisical.git
synced 2026-10-07 12:27:28 +00:00
fix: proper errors on failed to find env
This commit is contained in:
@@ -1,7 +1,7 @@
|
|||||||
import path from "node:path";
|
import path from "node:path";
|
||||||
|
|
||||||
import { TableName, TSecretFolders, TSecretsV2 } from "@app/db/schemas";
|
import { TableName, TSecretFolders, TSecretsV2 } from "@app/db/schemas";
|
||||||
import { ForbiddenRequestError } from "@app/lib/errors";
|
import { ForbiddenRequestError, NotFoundError } from "@app/lib/errors";
|
||||||
import { groupBy } from "@app/lib/fn";
|
import { groupBy } from "@app/lib/fn";
|
||||||
import { logger } from "@app/lib/logger";
|
import { logger } from "@app/lib/logger";
|
||||||
|
|
||||||
@@ -342,7 +342,7 @@ export const recursivelyGetSecretPaths = async ({
|
|||||||
});
|
});
|
||||||
|
|
||||||
if (!env) {
|
if (!env) {
|
||||||
throw new Error(`'${environment}' environment not found in project with ID ${projectId}`);
|
throw new NotFoundError({ message: `'${environment}' environment not found in project with ID ${projectId}` });
|
||||||
}
|
}
|
||||||
|
|
||||||
// Fetch all folders in env once with a single query
|
// Fetch all folders in env once with a single query
|
||||||
|
|||||||
@@ -152,7 +152,7 @@ export const recursivelyGetSecretPaths = ({
|
|||||||
});
|
});
|
||||||
|
|
||||||
if (!env) {
|
if (!env) {
|
||||||
throw new Error(`'${environment}' environment not found in project with ID ${projectId}`);
|
throw new NotFoundError({ message: `'${environment}' environment not found in project with ID ${projectId}` });
|
||||||
}
|
}
|
||||||
|
|
||||||
// Fetch all folders in env once with a single query
|
// Fetch all folders in env once with a single query
|
||||||
|
|||||||
Reference in New Issue
Block a user