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

◆ catch_()

template<typename T>
Promise & fl::task::Promise< T >::catch_ ( fl::function< void(const Error &)> callback)
inline

Register error callback - returns reference for chaining.

Parameters
callbackFunction to call when Promise rejects with error
Returns
Reference to this Promise for chaining

Definition at line 125 of file promise.h.

125 {
126 if (!valid()) return *this;
127
128 mImpl->set_catch_callback(fl::move(callback));
129 return *this;
130 }
fl::shared_ptr< detail::PromiseImpl< T > > mImpl
Shared pointer to implementation - this allows copying and sharing Promise state.
Definition promise.h:209
bool valid() const FL_NOEXCEPT
Check if Promise is valid.
Definition promise.h:108
Promise class that provides fluent .then() and .catch_() semantics This is a lightweight wrapper arou...
Definition promise.h:58

References Promise(), FL_NOEXCEPT, mImpl, fl::fl::move(), and valid().

+ Here is the call graph for this function: