feat: better api errors

This commit is contained in:
Daniel Hougaard
2024-09-17 22:53:51 +04:00
parent 10e7999334
commit 1c5a8cabe9
5 changed files with 103 additions and 14 deletions
@@ -26,7 +26,10 @@ export const getBotKeyFnFactory = (
) => {
const getBotKeyFn = async (projectId: string) => {
const project = await projectDAL.findById(projectId);
if (!project) throw new BadRequestError({ message: "Project not found during bot lookup." });
if (!project)
throw new BadRequestError({
message: "Project not found during bot lookup. Are you sure you are using the correct project ID?"
});
if (project.version === 3) {
return { project, shouldUseSecretV2Bridge: true };