FastLED 3.9.15
Loading...
Searching...
No Matches

◆ error()

template<typename T>
const Error & fl::result< T >::error ( ) const
inline

Get the error value.

Returns
Reference to the error
Warning
Returns static descriptive error if called on a success result
Note
Use !ok() to check before calling for proper error handling

Definition at line 102 of file promise_result.h.

102 {
103 if (ok()) {
104 // Return descriptive error for misuse detection
105 static const Error empty_error("No error - result contains success value");
106 return empty_error;
107 }
108 return mResult.template get<Error>();
109 }
bool ok() const
Check if the result is successful.
fl::Variant< T, Error > mResult
Result type for promise operations.
pair_element< I, T1, T2 >::type & get(pair< T1, T2 > &p) noexcept
Definition pair.h:113

References fl::get(), mResult, and ok().

Referenced by result(), result(), and error_message().

+ Here is the call graph for this function:
+ Here is the caller graph for this function: