feat(api): standardize errors as problem details

This commit is contained in:
dmg
2026-08-01 14:42:19 -04:00
parent 40abab7abc
commit 2657399628
16 changed files with 441 additions and 17 deletions
+20
View File
@@ -0,0 +1,20 @@
import { problemDetails } from "@minecraft-account-manager/contracts";
import { problemInstance, problemResponse } from "@/lib/problem-response";
function notFound(request: Request) {
const instance = problemInstance(request);
return problemResponse(problemDetails(
"urn:error:not-found",
"API route not found",
404,
"The requested API route does not exist.",
instance,
));
}
export const GET = notFound;
export const POST = notFound;
export const PUT = notFound;
export const PATCH = notFound;
export const DELETE = notFound;
export const OPTIONS = notFound;