Spaces:
Sleeping
Sleeping
Download Backend_node/src/utils/ApiError.ts from VashuTheGreat2/ML-Learner: direct link, hf CLI and curl.
- Browser
- Download file 457 Bytes
-
https://huggingface.co/spaces/VashuTheGreat2/ML-Learner/resolve/main/Backend_node/src/utils/ApiError.ts
- Command line
-
hf download hf://spaces/VashuTheGreat2/ML-Learner/Backend_node/src/utils/ApiError.ts
-
curl -L -o ApiError.ts https://huggingface.co/spaces/VashuTheGreat2/ML-Learner/resolve/main/Backend_node/src/utils/ApiError.ts
457 Bytes
| class ApiError extends Error { | |
| public statusCode: number; | |
| public success: boolean; | |
| constructor(status: number, message = "something went wrong") { | |
| super(message); | |
| this.statusCode = status; | |
| this.message = message; | |
| this.success = false; | |
| // Ensure the prototype is correctly set for built-in Error extension | |
| Object.setPrototypeOf(this, ApiError.prototype); | |
| } | |
| } | |
| export default ApiError; |