TypeScript Errors
The TypeScript SDK throws typed errors for API and configuration failures.
| Error | Meaning |
|---|---|
ApiError | The REST API returned an error response. |
ConfigError | Required SDK configuration is missing or invalid. |
import { ApiError, ConfigError, Runta } from "@runta/runta-sdk";
try { const runta = new Runta(); await runta.runtimes.get("missing-runtime");} catch (error) { if (error instanceof ApiError) { console.error(error.statusCode, error.code, error.message); } else if (error instanceof ConfigError) { console.error("Check RUNTA_TOKEN or endpoint configuration"); } else { throw error; }}Common Errors
Section titled “Common Errors”| Message | Action |
|---|---|
missing token: pass token or set RUNTA_TOKEN | Set RUNTA_TOKEN, pass token to new Runta(...), or configure ~/.config/runta/config.toml. |
ApiError: HTTP 401 | Check whether the token is missing, expired, or rejected by the endpoint. |
runtime ... did not reach running state | Try a longer timeoutMs in runtime.start({ wait: true, timeoutMs: 300000 }). |