treewide: stop use of deprecated coroutine::make_exception

Convert most use sites from `co_return coroutine::make_exception`
to `co_await coroutine::return_exception{,_ptr}` where possible.

In cases this is done in a catch clause, convert to
`co_return coroutine::exception`, generating an exception_ptr
if needed.

Signed-off-by: Benny Halevy <bhalevy@scylladb.com>

Closes #10972
This commit is contained in:
Benny Halevy
2022-07-05 11:19:57 +03:00
committed by Avi Kivity
parent bfc521ee9c
commit acae3cc223
9 changed files with 36 additions and 30 deletions

View File

@@ -1796,7 +1796,7 @@ future<db::commitlog::segment_manager::sseg_ptr> db::commitlog::segment_manager:
gate::holder g(_gate);
if (_shutdown) {
co_return coroutine::make_exception(std::runtime_error("Commitlog has been shut down. Cannot add data"));
co_await coroutine::return_exception(std::runtime_error("Commitlog has been shut down. Cannot add data"));
}
++_new_counter;