21 std::variant<std::nullptr_t, bool, std::int64_t, std::uint64_t, double, std::string>;
52 : code_(std::move(
code)), args_(std::move(
args)), origin_(
origin) {}
55 virtual const char*
what() const noexcept = 0;
57 const std::
string&
code() const noexcept {
return code_; }
70template <
typename Base = std::runtime_error>
76 const std::string& message,
80 const char*
what() const noexcept
override {
return Base::what(); }
88 std::optional<std::string>
args,
89 const std::string& message)
91 raw_args_(std::move(
args)) {}
93 const std::optional<std::string>&
raw_args() const noexcept {
return raw_args_; }
96 std::optional<std::string> raw_args_;
An engine-owned failure whose optional metadata is forwarded without reclassification.
const std::optional< std::string > & raw_args() const noexcept
Returns the untrusted engine JSON for transport validation, or unavailable metadata.
EngineError(std::optional< std::string > code, std::optional< std::string > args, const std::string &message)
Preserves unavailable getters as null metadata and the original diagnostic text.
A typed JSON scalar; strings in HPO-owned arguments use closed catalog vocabularies.
ErrorArgument(std::string value)
Constructs a string argument.
ErrorArgument(std::uint64_t value)
Constructs an unsigned integer argument.
ErrorArgument(std::nullptr_t value)
Constructs a null argument.
ErrorArgument(bool value)
Constructs a Boolean argument.
const Value & value() const noexcept
Returns the scalar value.
std::variant< std::nullptr_t, bool, std::int64_t, std::uint64_t, double, std::string > Value
Supported scalar types, including exact signed and unsigned persistence integers.
ErrorArgument(const char *value)
Constructs a string argument without converting string literals to Boolean.
ErrorArgument(std::int64_t value)
Constructs a signed integer argument.
ErrorArgument(double value)
Constructs a numeric argument.
Stable machine-readable failure metadata shared by the standard exception families.
FailureOrigin origin() const noexcept
Returns the component which owns the code.
const std::string & code() const noexcept
Returns the stable failure code, never inferred from diagnostic text.
virtual ~HpoError()=default
HpoError(std::string code, ErrorArguments args={}, FailureOrigin origin=FailureOrigin::Hpo)
Constructs metadata; HPO codes and argument vocabularies are defined by the catalog.
virtual const char * what() const noexcept=0
Returns the unchanged legacy English diagnostic.
const ErrorArguments & args() const noexcept
Returns typed, catalog-declared scalar arguments.
Adds stable metadata while preserving a standard exception's catch compatibility.
TypedHpoError(std::string code, ErrorArguments args, const std::string &message, FailureOrigin origin=FailureOrigin::Hpo)
Constructs a coded exception with unchanged English text and optional provenance.
const char * what() const noexcept override
Returns the original standard exception diagnostic.
FailureOrigin
Provenance of a failure, independent of its human-readable diagnostic.
std::map< std::string, ErrorArgument > ErrorArguments
Deterministically ordered failure arguments. No strategy-computed value belongs here.