You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Common operations and interfaces should have a well defined way in which they can fail (likely using std::expected). It should be possible to propagate errors up through functions with some sort of compound error object (combination of context and inner) in a concise manner. For example:
enumclassWangleError {
kCantGetFoo,
kWanglingByZero,
};
autoWangle() -> std::expected<int, obc::error::Error<
obc::error::Case<WangleError::kCantGetFoo, decltype(GetFoo())::error_type>,
obc::error::Case<WangleError::kWanglingByZero>
>> {
auto foo = GetFoo();
if (!foo) returnobc::error::Fail(WangleError::kCantGetFoo, foo);
// Use the value of foo
}
bugprone-unchecked-optional-access must be expanded to work with std::expected.
The text was updated successfully, but these errors were encountered:
Common operations and interfaces should have a well defined way in which they can fail (likely using
std::expected
). It should be possible to propagate errors up through functions with some sort of compound error object (combination of context and inner) in a concise manner. For example:bugprone-unchecked-optional-access
must be expanded to work withstd::expected
.The text was updated successfully, but these errors were encountered: