aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--promise.hpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/promise.hpp b/promise.hpp
index e197803..58b644f 100644
--- a/promise.hpp
+++ b/promise.hpp
@@ -177,7 +177,7 @@ namespace promise {
gen_on_fulfilled(on_fulfilled, npm)();
});
case State::Rejected:
- return promise_t([](promise_t npm) {});
+ return promise_t([this](promise_t npm) {npm.reject(reason);});
default: PROMISE_ERR_INVALID_STATE;
}
}
@@ -192,7 +192,7 @@ namespace promise {
add_on_fulfilled([this, npm]() {npm.resolve(result);});
});
case State::Fulfilled:
- return promise_t([](promise_t npm) {});
+ return promise_t([this](promise_t npm) {npm.resolve(result);});
case State::Rejected:
return promise_t([this, on_rejected](promise_t npm) {
add_on_rejected(gen_on_rejected(on_rejected, npm));