mo
refactor: public repo = client agent only — control plane + server packages moved off GitHub
76916b3 Download packages/engine/src/errors.mjs from aiagentmona/mona-agent: direct link, hf CLI and curl.
- Browser
- Download file 729 Bytes
-
https://huggingface.co/aiagentmona/mona-agent/resolve/main/packages/engine/src/errors.mjs
- Command line
-
hf download hf://aiagentmona/mona-agent/packages/engine/src/errors.mjs
-
curl -L -o errors.mjs https://huggingface.co/aiagentmona/mona-agent/resolve/main/packages/engine/src/errors.mjs
729 Bytes
| /** | |
| * Client-side error helpers (minimal subset, self-contained). | |
| * `message` is always safe to display to the user. | |
| */ | |
| export class AppError extends Error { | |
| constructor(status, code, message, { details = null, internal = null } = {}) { | |
| super(message); | |
| this.name = 'AppError'; | |
| this.status = status; | |
| this.code = code; | |
| this.details = details; | |
| this.internal = internal; | |
| } | |
| } | |
| const make = (status, code, fallback) => (message = fallback, opts) => | |
| new AppError(status, code, message, opts); | |
| export const providerError = make(502, 'PROVIDER_ERROR', 'The upstream AI provider returned an error.'); | |
| export const unavailable = make(503, 'SERVICE_UNAVAILABLE', 'The service is temporarily unavailable.'); | |