Spaces:
Paused
Paused
Download src/infra/outbound/target-errors.ts from nikhtu10/OpenClawBot: direct link, hf CLI and curl.
- Browser
- Download file 1.18 kB
-
https://huggingface.co/spaces/nikhtu10/OpenClawBot/resolve/main/src/infra/outbound/target-errors.ts
- Command line
-
hf download hf://spaces/nikhtu10/OpenClawBot/src/infra/outbound/target-errors.ts
-
curl -L -o target-errors.ts https://huggingface.co/spaces/nikhtu10/OpenClawBot/resolve/main/src/infra/outbound/target-errors.ts
1.18 kB
| export function missingTargetMessage(provider: string, hint?: string): string { | |
| return `Delivering to ${provider} requires target${formatTargetHint(hint)}`; | |
| } | |
| export function missingTargetError(provider: string, hint?: string): Error { | |
| return new Error(missingTargetMessage(provider, hint)); | |
| } | |
| export function ambiguousTargetMessage(provider: string, raw: string, hint?: string): string { | |
| return `Ambiguous target "${raw}" for ${provider}. Provide a unique name or an explicit id.${formatTargetHint(hint, true)}`; | |
| } | |
| export function ambiguousTargetError(provider: string, raw: string, hint?: string): Error { | |
| return new Error(ambiguousTargetMessage(provider, raw, hint)); | |
| } | |
| export function unknownTargetMessage(provider: string, raw: string, hint?: string): string { | |
| return `Unknown target "${raw}" for ${provider}.${formatTargetHint(hint, true)}`; | |
| } | |
| export function unknownTargetError(provider: string, raw: string, hint?: string): Error { | |
| return new Error(unknownTargetMessage(provider, raw, hint)); | |
| } | |
| function formatTargetHint(hint?: string, withLabel = false): string { | |
| if (!hint) { | |
| return ""; | |
| } | |
| return withLabel ? ` Hint: ${hint}` : ` ${hint}`; | |
| } | |