Skip to content

Commit

Permalink
future-utils: fix do_for_each exception reporting
Browse files Browse the repository at this point in the history
If `action` throws, the caller expects an exceptional future rather than
an exception.  Use `futurize::apply()` to satisfy that expectaion.
Message-Id: <[email protected]>
  • Loading branch information
avikivity authored and duarten committed Jul 6, 2017
1 parent 1fa1323 commit 89cc97c
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion core/future-util.hh
Original file line number Diff line number Diff line change
Expand Up @@ -370,7 +370,7 @@ future<> do_for_each(Iterator begin, Iterator end, AsyncAction&& action) {
return make_ready_future<>();
}
while (true) {
auto f = action(*begin++);
auto f = futurize<void>::apply(action, *begin++);
if (begin == end) {
return f;
}
Expand Down

0 comments on commit 89cc97c

Please sign in to comment.