Spaces:
Paused
Paused
ML Intern deploy
Deploy httpSMS gateway to Hugging Face Spaces (Docker SDK): nginx :7860 -> Go API :8000, Nuxt SPA, Android APK, bootstrap-mode entrypoint
83a59ca Download web/app/utils/api-error.ts from red-kit/httpsms-gateway: direct link, hf CLI and curl.
- Browser
- Download file 497 Bytes
-
https://huggingface.co/spaces/red-kit/httpsms-gateway/resolve/main/web/app/utils/api-error.ts
- Command line
-
hf download hf://spaces/red-kit/httpsms-gateway/web/app/utils/api-error.ts
-
curl -L -o api-error.ts https://huggingface.co/spaces/red-kit/httpsms-gateway/resolve/main/web/app/utils/api-error.ts
497 Bytes
| /** | |
| * Shape of the error object thrown by ofetch/$fetch for failed API requests. | |
| */ | |
| export interface ApiError { | |
| status?: number | |
| data?: { | |
| message?: string | |
| data?: Record<string, string[]> | |
| } | |
| } | |
| export function toApiError(error: unknown): ApiError { | |
| if (error !== null && typeof error === 'object') { | |
| return error as ApiError | |
| } | |
| return {} | |
| } | |
| export function getApiErrorMessage(error: unknown, fallback: string): string { | |
| return toApiError(error).data?.message ?? fallback | |
| } | |