Download src/utils/AppError.ts from lynfera/api: direct link, hf CLI and curl.
- Browser
- Download file 626 Bytes
-
https://huggingface.co/spaces/lynfera/api/resolve/c044fc22a5e2de895ca9282affe402eeab2b7f3d/src/utils/AppError.ts
- Command line
-
hf download hf://spaces/lynfera/api@c044fc22a5e2de895ca9282affe402eeab2b7f3d/src/utils/AppError.ts
-
curl -L -o AppError.ts https://huggingface.co/spaces/lynfera/api/resolve/c044fc22a5e2de895ca9282affe402eeab2b7f3d/src/utils/AppError.ts
626 Bytes
| class AppError extends Error { | |
| public statusCode: number; | |
| public cause?: unknown; | |
| constructor(message: string, code: number, err?: any) { | |
| super(message); | |
| this.statusCode = code; | |
| this.name = "AppError"; | |
| this.cause = err; | |
| Error.captureStackTrace(this, this.constructor); | |
| } | |
| } | |
| export default AppError; | |
| export class WebhookError extends Error { | |
| public code: number; | |
| public cause?: unknown; | |
| constructor(message: string, code: number, err?: any) { | |
| super("WebhookError => " + message); | |
| this.code = code; | |
| this.name = "WebhookError"; | |
| this.cause = err; | |
| Error.captureStackTrace(this, this.constructor); | |
| } | |
| } | |