return transform("transform: " + func.getClass().getName(), func);
}
default Task<T> recoverWith(final String desc, final Function1<Throwable, Task<T>> func) {
ArgumentUtil.requireNotNull(func, "function");
final Task<T> that = this;
<BUG>return async(desc, context -> {
final SettablePromise<T> result = Promises.settable();</BUG>
final Task<T> recovery = async("recovery", ctx -> {
final SettablePromise<T> recoveryResult = Promises.settable();
if (that.isFailed()) {

return transform("transform: " + func.getClass().getName(), func);
}
default Task<T> recoverWith(final String desc, final Function1<Throwable, Task<T>> func) {
ArgumentUtil.requireNotNull(func, "function");
final Task<T> that = this;
Task<T> recoverWithTask = async(desc, context -> {
final SettablePromise<T> result = Promises.settable();
final Task<T> recovery = async("recovery", ctx -> {
final SettablePromise<T> recoveryResult = Promises.settable();
if (that.isFailed()) {
