Skip to content

Infisical is the open-source platform for securing secrets, certificates, access, and AI Agents.

use RequestError instead of Error for bot

Maidul Islamf799e224a079
diff --git a/backend/src/helpers/bot.ts b/backend/src/helpers/bot.ts
index 275ca09889..63814434d6 100644
--- a/backend/src/helpers/bot.ts
+++ b/backend/src/helpers/bot.ts
@@ -13,7 +13,7 @@ import {
SECRET_SHARED
} from "../variables";
import { client, getEncryptionKey, getRootEncryptionKey } from "../config";
-import { InternalServerError } from "../utils/errors";
+import { BotNotFoundError, InternalServerError } from "../utils/errors";
import { Folder } from "../models";
import { getFolderByPath } from "../services/FolderService";
import { getAllImportedSecrets } from "../services/SecretImportService";
@@ -223,7 +223,7 @@ export const getKey = async ({ workspaceId }: { workspaceId: Types.ObjectId }) =
workspace: workspaceId
}).populate<{ sender: IUser }>("sender", "publicKey");
- if (!botKey) throw new Error("Failed to find bot key");
+ if (!botKey) throw BotNotFoundError({ message: `getKey: Failed to find bot key for [workspaceId=${workspaceId}]` })
const bot = await Bot.findOne({
workspace: workspaceId