Area restrita - Questionario

This commit is contained in:
2026-06-08 23:50:59 -03:00
parent f2e2400637
commit ef968f10ae
6972 changed files with 23454 additions and 2267883 deletions
+15
View File
@@ -0,0 +1,15 @@
type AppError = { tag: "app_error"; status: number; message: string };
function appError(status: number, message: string): AppError {
return { tag: "app_error", status, message };
}
export const Errors = {
badRequest: (msg: string) => appError(400, msg),
unauthorized: (msg: string) => appError(401, msg),
forbidden: (msg: string) => appError(403, msg),
notFound: (msg: string) => appError(404, msg),
internal: (msg: string) => appError(500, msg),
} as const;
export type { AppError };