Skip to content

Commit

Permalink
use folly::current_exception in various places
Browse files Browse the repository at this point in the history
Summary: Use `folly::current_exception()` v.s. `std::current_exception()` in various places as a small acceleration.

Reviewed By: Orvid

Differential Revision: D58564207

fbshipit-source-id: a8da72f86030dc9080de7327bc618478a14d4903
  • Loading branch information
yfeldblum authored and facebook-github-bot committed Jun 21, 2024
1 parent 35e554f commit 9b163d8
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion wangle/bootstrap/ServerBootstrap.h
Original file line number Diff line number Diff line change
Expand Up @@ -242,7 +242,7 @@ class ServerBootstrap {

barrier->post();
} catch (...) {
exn = std::current_exception();
exn = folly::current_exception();
barrier->post();

return;
Expand Down
4 changes: 2 additions & 2 deletions wangle/client/persistence/FilePersistenceLayer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ bool FilePersistenceLayer::persist(const folly::dynamic& dynObj) noexcept {
serializedCache = folly::json::serialize(dynObj, opts);
} catch (...) {
LOG(ERROR) << "Serializing to JSON failed with error: "
<< folly::exceptionStr(std::current_exception());
<< folly::exceptionStr(folly::current_exception());
return false;
}
bool persisted = false;
Expand Down Expand Up @@ -77,7 +77,7 @@ folly::Optional<folly::dynamic> FilePersistenceLayer::load() noexcept {
return folly::parseJson(serializedCache, opts);
} catch (...) {
LOG(ERROR) << "Deserialization of cache file " << file_
<< "failed: " << folly::exceptionStr(std::current_exception());
<< "failed: " << folly::exceptionStr(folly::current_exception());
return folly::none;
}
}
Expand Down

0 comments on commit 9b163d8

Please sign in to comment.