holoscan::Error
Lightweight error value for the expected<T, Error> return path.
Error is the value type to return (via holoscan::expected / make_unexpected) when reporting a recoverable failure, as opposed to throwing. It is intentionally cheap: it carries an ErrorCode and an optional message, and allocates only when the message is non-empty. The common “code only” case (e.g. returning kNotReady / kBackpressured from a hot polling path) performs no allocation, in contrast to RuntimeError, which (as a std::runtime_error) always copies its message into a heap buffer and carries exception RTTI.
When an empty message is rendered (e.g. by the RuntimeError bridge), error_code_name(code) / the code’s error string is used in its place.
Use RuntimeError when an exception must be thrown; a RuntimeError can be constructed from an Error (see RuntimeError(const Error&)), so throw RuntimeError(result.error()); stays a one-liner.