Structured error type for ExBurn operations.
Fields
:op— the operation that failed (e.g.,:add,:matmul,:conv):reason— a human-readable error message:details— optional map with additional context (shapes, types, etc.)
Examples
raise ExBurn.Error, op: :matmul, reason: "shape mismatch",
details: %{lhs: [3, 4], rhs: [5, 6]}
Summary
Functions
Formats an error for logging or display.
Wraps an error tuple in an ExBurn.Error.
Creates an error struct (non-raising).
Converts the error to a string representation suitable for logging.
Types
Functions
Formats an error for logging or display.
Returns a string with the operation, reason, and any details.
Wraps an error tuple in an ExBurn.Error.
Examples
iex> ExBurn.Error.from_tuple({:error, "something failed"}, op: :forward)
%ExBurn.Error{op: :forward, reason: "something failed", details: nil}
Creates an error struct (non-raising).
Useful for returning errors in pipelines without raising.
Examples
iex> ExBurn.Error.new(op: :add, reason: %{"bad input"})
%ExBurn.Error{op: :add, reason: "bad input", details: nil}
Converts the error to a string representation suitable for logging.