Spaces:
Sleeping
Sleeping
Download src/libs/shared/error/ErrorBuilder.ts from fouadkhalid123/asd: direct link, hf CLI and curl.
- Browser
- Download file 465 Bytes
-
https://huggingface.co/spaces/fouadkhalid123/asd/resolve/main/src/libs/shared/error/ErrorBuilder.ts
- Command line
-
hf download hf://spaces/fouadkhalid123/asd/src/libs/shared/error/ErrorBuilder.ts
-
curl -L -o ErrorBuilder.ts https://huggingface.co/spaces/fouadkhalid123/asd/resolve/main/src/libs/shared/error/ErrorBuilder.ts
465 Bytes
| import { ApiError } from "../api/ApiError"; | |
| export class ErrorBuilder { | |
| static unauthorized(message = "Unauthorized"): ApiError { | |
| return new ApiError(401, "UNAUTHORIZED", message); | |
| } | |
| static notFound(resource: string): ApiError { | |
| return new ApiError(404, "NOT_FOUND", `${resource} not found`); | |
| } | |
| static internal(message = "Internal server error"): ApiError { | |
| return new ApiError(500, "INTERNAL_ERROR", message); | |
| } | |
| } |