Spaces:
Sleeping
Sleeping
Download dashboard/features/shared/errors.js from JuanCS-Dev/twitch-byte-bot: direct link, hf CLI and curl.
- Browser
- Download file 410 Bytes
-
https://huggingface.co/spaces/JuanCS-Dev/twitch-byte-bot/resolve/main/dashboard/features/shared/errors.js
- Command line
-
hf download hf://spaces/JuanCS-Dev/twitch-byte-bot/dashboard/features/shared/errors.js
-
curl -L -o errors.js https://huggingface.co/spaces/JuanCS-Dev/twitch-byte-bot/resolve/main/dashboard/features/shared/errors.js
410 Bytes
| export function getErrorMessage(error, fallbackMessage) { | |
| const payload = error && typeof error.payload === "object" ? error.payload : {}; | |
| const fromPayload = payload?.message || payload?.error; | |
| if (String(fromPayload || "").trim()) { | |
| return String(fromPayload); | |
| } | |
| if (String(error?.message || "").trim()) { | |
| return String(error.message); | |
| } | |
| return fallbackMessage; | |
| } | |