Spaces:
Paused
Paused
Chandra Kiran
Harden simulation runs: official Foxglove embed, WebM video, CI image build
04ad412 unverified Download api/static/foxglove-embed/toError.js from chandrakiran06/rosdiff: direct link, hf CLI and curl.
- Browser
- Download file 559 Bytes
-
https://huggingface.co/spaces/chandrakiran06/rosdiff/resolve/main/api/static/foxglove-embed/toError.js
- Command line
-
hf download hf://spaces/chandrakiran06/rosdiff/api/static/foxglove-embed/toError.js
-
curl -L -o toError.js https://huggingface.co/spaces/chandrakiran06/rosdiff/resolve/main/api/static/foxglove-embed/toError.js
559 Bytes
| /** | |
| * Converts an unknown caught value to an Error. Useful for catch blocks. | |
| * | |
| * Kept local because published embed packages cannot import private `@foxglove/common`. | |
| * | |
| * @param err - The caught value to convert | |
| * @param defaultMessage - Fallback message if `err` is not an Error instance | |
| * @returns The original Error if `err` is an Error, otherwise a new Error with `defaultMessage` | |
| */ | |
| export function toError(err, defaultMessage = "Unknown error") { | |
| if (err instanceof Error) { | |
| return err; | |
| } | |
| return new Error(defaultMessage); | |
| } | |