Skip to content

TypeScript Errors

The TypeScript SDK throws typed errors for API and configuration failures.

ErrorMeaning
ApiErrorThe REST API returned an error response.
ConfigErrorRequired 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;
}
}
MessageAction
missing token: pass token or set RUNTA_TOKENSet RUNTA_TOKEN, pass token to new Runta(...), or configure ~/.config/runta/config.toml.
ApiError: HTTP 401Check whether the token is missing, expired, or rejected by the endpoint.
runtime ... did not reach running stateTry a longer timeoutMs in runtime.start({ wait: true, timeoutMs: 300000 }).