Spaces:
Runtime error
Runtime error
Download src/utils/bull/JobDetailedError.ts from NitinBot002/waha: direct link, hf CLI and curl.
- Browser
- Download file 566 Bytes
-
https://huggingface.co/spaces/NitinBot002/waha/resolve/main/src/utils/bull/JobDetailedError.ts
- Command line
-
hf download hf://spaces/NitinBot002/waha/src/utils/bull/JobDetailedError.ts
-
curl -L -o JobDetailedError.ts https://huggingface.co/spaces/NitinBot002/waha/resolve/main/src/utils/bull/JobDetailedError.ts
566 Bytes
| import * as util from 'node:util'; | |
| export class JobDetailedError extends Error { | |
| originalError: unknown; | |
| constructor(err: unknown) { | |
| const inspected = util.inspect(err, { | |
| showHidden: false, | |
| depth: 2, | |
| colors: false, | |
| }); | |
| super(inspected); | |
| this.name = 'JobDetailedError'; | |
| this.originalError = err; | |
| // Ensure the stack trace is captured properly | |
| if (err instanceof Error && err.stack) { | |
| this.stack = `${this.name}:\n${inspected}`; | |
| } else { | |
| Error.captureStackTrace(this, this.constructor); | |
| } | |
| } | |
| } | |