feat(api): standardize errors as problem details
This commit is contained in:
@@ -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;
|
||||
Reference in New Issue
Block a user