always return a response

This commit is contained in:
Andreas 2025-01-14 03:24:24 +01:00
parent 831bdb8faa
commit 5c0e3577a8

View File

@ -24,7 +24,7 @@ import {
SqliteQueryInterface,
} from "@sequelize/sqlite3";
import { hashpassword } from "@/util/auth";
import { copyFile, copyFileSync, mkdirSync, readFileSync } from "fs";
import { copyFileSync, mkdirSync, readFileSync } from "fs";
import path from "path";
import { UUID } from "crypto";
import { runApiAction } from "@/util/api";
@ -194,6 +194,7 @@ export async function GET(request: Request) {
if (e instanceof APIError) {
return new Response(e.info.responseText, { status: e.info.status });
} else {
return new Response(JSON.stringify(e));
throw e;
}
}