moving v2 to top level

This commit is contained in:
2024-12-17 09:19:21 -07:00
parent 5f0b3554dc
commit 576ee02afb
468 changed files with 79 additions and 15430 deletions

View File

@@ -0,0 +1,13 @@
import { NextResponse } from "next/server";
export async function withErrorHandling(handler: () => Promise<Response | NextResponse>) {
try {
return await handler();
} catch (error) {
console.error("Error caught in centralized handler:", error);
return NextResponse.json(
{ error: (error as Error).message || "Internal Server Error" },
{ status: 500 }
);
}
}