Download src/gateway/protocol/schema/error-codes.ts from quinnz/openclaw: direct link, hf CLI and curl.
- Browser
- Download file 529 Bytes
-
https://huggingface.co/spaces/quinnz/openclaw/resolve/main/src/gateway/protocol/schema/error-codes.ts
- Command line
-
hf download hf://spaces/quinnz/openclaw/src/gateway/protocol/schema/error-codes.ts
-
curl -L -o error-codes.ts https://huggingface.co/spaces/quinnz/openclaw/resolve/main/src/gateway/protocol/schema/error-codes.ts
529 Bytes
| import type { ErrorShape } from "./types.js"; | |
| export const ErrorCodes = { | |
| NOT_LINKED: "NOT_LINKED", | |
| NOT_PAIRED: "NOT_PAIRED", | |
| AGENT_TIMEOUT: "AGENT_TIMEOUT", | |
| INVALID_REQUEST: "INVALID_REQUEST", | |
| UNAVAILABLE: "UNAVAILABLE", | |
| } as const; | |
| export type ErrorCode = (typeof ErrorCodes)[keyof typeof ErrorCodes]; | |
| export function errorShape( | |
| code: ErrorCode, | |
| message: string, | |
| opts?: { details?: unknown; retryable?: boolean; retryAfterMs?: number }, | |
| ): ErrorShape { | |
| return { | |
| code, | |
| message, | |
| ...opts, | |
| }; | |
| } | |