bsdkrun/error

The single error type returned by every fallible function in the SDK.

Types

Why a call failed.

  • BinaryNotFound — the bsdkrun binary could not be located; carries every path that was searched.
  • CommandFailed — a bsdkrun invocation exited non-zero; carries the exit code, both captured streams, and a label naming the command.
  • SandboxNotFound — no machine matched the given id or prefix.
  • DecodeFailedbsdkrun --json produced output the SDK could not decode; carries the raw text.
  • InvalidOptions — the create options were internally inconsistent, e.g. a required field left empty.
pub type Error {
  BinaryNotFound(searched: List(String))
  CommandFailed(
    exit_code: Int,
    stdout: String,
    stderr: String,
    label: String,
  )
  SandboxNotFound(id: String)
  DecodeFailed(label: String, raw: String)
  InvalidOptions(message: String)
}

Constructors

  • BinaryNotFound(searched: List(String))
  • CommandFailed(
      exit_code: Int,
      stdout: String,
      stderr: String,
      label: String,
    )
  • SandboxNotFound(id: String)
  • DecodeFailed(label: String, raw: String)
  • InvalidOptions(message: String)

Values

pub fn to_string(error: Error) -> String

A human-readable, single-block rendering of an error — the string you would print or log.

Search Document