From cb36ee118d1ecdce4068ba86c03775b84db66a21 Mon Sep 17 00:00:00 2001 From: Azalea <22280294+hykilpikonna@users.noreply.github.com> Date: Sat, 25 Oct 2025 22:17:41 +0800 Subject: [PATCH] Update index.ts --- src/index.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/index.ts b/src/index.ts index 9e12c6d..2a0ecd1 100644 --- a/src/index.ts +++ b/src/index.ts @@ -23,7 +23,7 @@ class HttpError extends Error { super() } } -function done(status: number, content: string | object) { +function done(status: number, content: string | object): never { throw new HttpError(status, content) } @@ -175,7 +175,7 @@ export const app = new Elysia() const photo = metadata.find((p) => p.id === id) // Not found or hidden - if (!photo || photo.hide === true) throw done(404, "Photo not found") + if (!photo || photo.hide === true) done(404, "Photo not found") const file = Bun.file(photo.edited_photo.path) if (!(await file.exists())) {