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

◆ catch_()

template<typename T>
promise & fl::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 139 of file promise.h.

139 {
140 if (!valid()) return *this;
141
142 mImpl->set_catch_callback(fl::move(callback));
143 return *this;
144 }
bool valid() const
Check if promise is valid.
Definition promise.h:122
fl::shared_ptr< detail::PromiseImpl< T > > mImpl
Shared pointer to implementation - this allows copying and sharing promise state.
Definition promise.h:223
Promise class that provides fluent .then() and .catch_() semantics This is a lightweight wrapper arou...
Definition promise.h:72

References promise(), mImpl, fl::move(), and valid().

+ Here is the call graph for this function: