Skip to content

beryl/error

Shared beryl-owned error helpers.

pub type CallError {
CallUnavailable
CallDown(reason: process.ExitReason)
CallTimedOut
}

A synchronous actor call could not obtain a reply.

pub type OperationFailure

An underlying native operation failure, retained without lossy conversion.

Only native operation boundaries construct this value. Format it on demand with describe_operation_failure; the original reason remains intact.

pub type StartFailure

A stable description of an internal beryl actor startup failure.

This type hides OTP's actor.StartError so public APIs do not expose dependency-specific error constructors.

pub fn describe_call_error(CallError) -> String

Describe an actor-call failure, including its original exit reason.

pub fn describe_operation_failure(OperationFailure) -> String

Describe a native failure with bounded nesting and output length.

pub fn describe_start_failure(StartFailure) -> String

Return a human-readable description of a startup failure.

Abnormal exits retain their underlying reason internally. Their description includes a depth- and length-limited rendering so large exit terms cannot produce unbounded diagnostic output.

pub fn from_actor_start_error(actor.StartError) -> StartFailure

Convert a gleam/otp/actor.StartError to beryl's StartFailure.