Download src/commands/models/list.errors.ts from shimen/shinclaw: direct link, hf CLI and curl.
- Browser
- Download file 494 Bytes
-
https://huggingface.co/spaces/shimen/shinclaw/resolve/main/src/commands/models/list.errors.ts
- Command line
-
hf download hf://spaces/shimen/shinclaw/src/commands/models/list.errors.ts
-
curl -L -o list.errors.ts https://huggingface.co/spaces/shimen/shinclaw/resolve/main/src/commands/models/list.errors.ts
494 Bytes
| export const MODEL_AVAILABILITY_UNAVAILABLE_CODE = "MODEL_AVAILABILITY_UNAVAILABLE"; | |
| export function formatErrorWithStack(err: unknown): string { | |
| if (err instanceof Error) { | |
| return err.stack ?? `${err.name}: ${err.message}`; | |
| } | |
| return String(err); | |
| } | |
| export function shouldFallbackToAuthHeuristics(err: unknown): boolean { | |
| if (!(err instanceof Error)) { | |
| return false; | |
| } | |
| const code = (err as { code?: unknown }).code; | |
| return code === MODEL_AVAILABILITY_UNAVAILABLE_CODE; | |
| } | |