Skip to navigation

holoscan::params::ParamToolError

Beta
View as Markdown

Own one typed optional-tooling failure without widening Core ErrorCode.

The value owns a bounded machine token and optional structured causes. Copying the value preserves every cause. Construction performs no unbounded token allocation and the resulting object is safe to read concurrently while no thread mutates or destroys it.

#include <holoscan/params/error.hpp>

Constructors

ParamToolError

holoscan::params::ParamToolError::ParamToolError(
std::string_view token,
std::optional<Error> core = std::nullopt,
std::optional<config::ConfigError> config = std::nullopt
) noexcept

Construct one bounded tooling failure.

Construction does not throw and does not log.

Parameters

code
ParamToolErrorCode

Stable tooling category.

token
std::string_view

Stable diagnostic token beginning with an ASCII uppercase letter and containing only ASCII uppercase letters, digits, or underscores. An invalid or oversized token maps to the bounded PARAM_TOOL_TOKEN_INVALID sentinel.

core
std::optional<Error>Defaults to std::nullopt

Optional owning Core cause to preserve structurally.

config
std::optional<config::ConfigError>Defaults to std::nullopt

Optional owning Config cause to preserve structurally.


Methods

code

ParamToolErrorCode holoscan::params::ParamToolError::code() const noexcept

Return the stable tooling category.

token

std::string_view holoscan::params::ParamToolError::token() const noexcept

Return the stable diagnostic token.

The view remains valid until this error is assigned or destroyed.

core_cause

const std::optional<Error> & holoscan::params::ParamToolError::core_cause() const noexcept

Return the preserved Core cause when one exists.

Returns: Reference valid until this error is assigned or destroyed.

config_cause

const std::optional<config::ConfigError> & holoscan::params::ParamToolError::config_cause() const noexcept

Return the preserved Config cause when one exists.

The returned reference remains valid until this error is assigned or destroyed.

Returns: Owning bounded Config diagnostic, or empty when the failure did not originate there.


Member variables

NameTypeDescription
kTokenCapacity static constexprstd::size_tMaximum number of bytes retained for one stable diagnostic token.
code_ParamToolErrorCode
token_std::array< char, kTokenCapacity >
token_size_std::uint8_t
core_std::optional< Error >
config_std::optional< config::ConfigError >