diff --git a/src/database/database.ts b/src/database/database.ts index 99eb02c..5e52d2f 100644 --- a/src/database/database.ts +++ b/src/database/database.ts @@ -17,7 +17,7 @@ export async function connect() { } export async function getRepository(repoId: string) { - if (!repoId) { + if (!repoId || repoId == 'undefined') { throw new AnonymousError("repo_not_found", { object: repoId, httpStatus: 404, diff --git a/src/routes/route-utils.ts b/src/routes/route-utils.ts index f3c4361..0bc7c72 100644 --- a/src/routes/route-utils.ts +++ b/src/routes/route-utils.ts @@ -49,6 +49,8 @@ function printError(error: any, req?: express.Request) { .trim()}`; if (req) { message += ` ${req.originalUrl}`; + // ignore common error + if (req.originalUrl === '/api/repo/undefined/options') return } console.error(message); } else if (error instanceof Error) {