Spaces:
Running
Running
Download src/exception/errors.js from hari7775/resume-server: direct link, hf CLI and curl.
- Browser
- Download file 603 Bytes
-
https://huggingface.co/spaces/hari7775/resume-server/resolve/main/src/exception/errors.js
- Command line
-
hf download hf://spaces/hari7775/resume-server/src/exception/errors.js
-
curl -L -o errors.js https://huggingface.co/spaces/hari7775/resume-server/resolve/main/src/exception/errors.js
603 Bytes
| // Errors thrown by services/controllers; the error middleware turns them into JSON responses. | |
| export class AppError extends Error { | |
| constructor(status, code, message) { | |
| super(message); | |
| this.status = status; | |
| this.code = code; | |
| } | |
| } | |
| export class BadRequestError extends AppError { | |
| constructor(message) { super(400, 'BAD_REQUEST', message); } | |
| } | |
| export class ForbiddenError extends AppError { | |
| constructor(message) { super(403, 'FORBIDDEN', message); } | |
| } | |
| export class NotFoundError extends AppError { | |
| constructor(message) { super(404, 'NOT_FOUND', message); } | |
| } | |