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())) {