Smith.Error (Smith v0.1.0)

Copy Markdown View Source

A failed modeling step, optionally associated with an assembly part.

  • :step — one-based operation index in construction order, or nil for an assembly member validation failure.
  • :operation — the failed recipe operation, :assembly, :joint, or :connect.
  • :reason — an error atom or a nested Smith.Error from a tool recipe.
  • :part — the original top-level member name, a normalized slash path for a nested failure, the joint/connection endpoint for joint errors, or nil outside an assembly.

This is a result value, not an exception. Match on it in {:error, %Smith.Error{}}. Some top-level failures return bare atoms; callback exceptions propagate instead of becoming this struct.

Summary

Types

t()

@type t() :: %Smith.Error{
  operation: atom(),
  part: atom() | String.t() | nil,
  reason: atom() | t(),
  step: pos_integer() | nil
}