Download errors.js from felix-fx/fx-craft: direct link, hf CLI and curl.
- Browser
- Download file 522 Bytes
-
https://huggingface.co/spaces/felix-fx/fx-craft/resolve/main/errors.js
- Command line
-
hf download hf://spaces/felix-fx/fx-craft/errors.js
-
curl -L -o errors.js https://huggingface.co/spaces/felix-fx/fx-craft/resolve/main/errors.js
522 Bytes
| export class AppError extends Error { | |
| constructor(message) { | |
| super(message); | |
| this.name = this.constructor.name; | |
| } | |
| } | |
| export class NotFoundError extends AppError { | |
| constructor(resource) { | |
| super(`${resource} not found`); | |
| this.statusCode = 404; | |
| } | |
| } | |
| export class ValidationError extends AppError { | |
| constructor(message) { | |
| super(message); | |
| this.statusCode = 400; | |
| } | |
| } | |
| export class DatabaseError extends AppError { | |
| constructor(message) { | |
| super(message); | |
| this.statusCode = 500; | |
| } | |
| } | |