Skip to content

Errors

Errors raised by configuration, API, and command operations.

Base error for failures raised by the Runta SDK.

class RuntaError extends Error
new RuntaError(message: string): RuntaError
NameTypeDefaultDescription
messagestringRequiredHuman-readable error message.
  • RuntaError

Raised when required SDK configuration is missing or invalid.

class ConfigError extends RuntaError
new ConfigError(message: string): ConfigError
NameTypeDefaultDescription
messagestringRequiredHuman-readable error message.
  • ConfigError

Raised when the Runta API returns an unsuccessful response.

class ApiError extends RuntaError
new ApiError(message: string, options: { code?: string; statusCode?: number } = {}): ApiError
NameTypeDefaultDescription
messagestringRequiredHuman-readable error message.
options{ code?: string; statusCode?: number }{}Options that control the operation.
  • ApiError
NameTypeDescription
codestring | undefinedRunta API error code, when available.
statusCodenumber | undefinedHTTP status code, when available.

Format the HTTP status, API code, and message.

ApiError.toString(): string
  • string

Raised when a runtime command fails under strict execution behavior.

class CommandError extends RuntaError
new CommandError(message: string, options: { exitCode?: number } = {}): CommandError
NameTypeDefaultDescription
messagestringRequiredHuman-readable error message.
options{ exitCode?: number }{}Options that control the operation.
  • CommandError
NameTypeDescription
exitCodenumber | undefinedCommand exit code, when available.