Skip to content

Commit

Permalink
Make FutureRequest::processClientInterceptorsAndExtractResult noexcept
Browse files Browse the repository at this point in the history
Summary: It's returning a `folly::Try` should the function itself should avoid throwing. `extractResult` can throw if the RPC threw an exception.

Reviewed By: iahs

Differential Revision: D62657033

fbshipit-source-id: 1ffa8b14f2a6f02c227f7f2c5aaa2ece10f013ba
  • Loading branch information
praihan authored and facebook-github-bot committed Sep 17, 2024
1 parent fb3d5e5 commit 3d534d1
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions thrift/lib/cpp2/async/FutureRequest.h
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ class FutureCallbackHelper {
}

static folly::Try<Result> processClientInterceptorsAndExtractResult(
PromiseResult&& result) {
PromiseResult&& result) noexcept {
apache::thrift::ClientReceiveState clientReceiveState =
extractClientReceiveState(result);
auto* contextStack = clientReceiveState.ctx();
Expand All @@ -86,7 +86,7 @@ class FutureCallbackHelper {
return folly::Try<Result>(std::move(exTry).exception());
}
}
return folly::Try<Result>(extractResult(std::move(result)));
return folly::makeTryWith([&] { return extractResult(std::move(result)); });
}
};

Expand Down

0 comments on commit 3d534d1

Please sign in to comment.