mirror of
https://github.com/BradNut/TofuStack
synced 2025-09-08 17:40:26 +00:00
22 lines
605 B
TypeScript
22 lines
605 B
TypeScript
|
|
import { HTTPException } from 'hono/http-exception';
|
||
|
|
|
||
|
|
export function Forbidden(message: string = 'Forbidden') {
|
||
|
|
return new HTTPException(403, { message });
|
||
|
|
}
|
||
|
|
|
||
|
|
export function Unauthorized(message: string = 'Unauthorized') {
|
||
|
|
return new HTTPException(401, { message });
|
||
|
|
}
|
||
|
|
|
||
|
|
export function NotFound(message: string = 'Not Found') {
|
||
|
|
return new HTTPException(404, { message });
|
||
|
|
}
|
||
|
|
|
||
|
|
export function BadRequest(message: string = 'Bad Request') {
|
||
|
|
return new HTTPException(400, { message });
|
||
|
|
}
|
||
|
|
|
||
|
|
export function InternalError(message: string = 'Internal Error') {
|
||
|
|
return new HTTPException(500, { message });
|
||
|
|
}
|