Skip to content

Commit

Permalink
Fix OSS build for unavailable Folly type
Browse files Browse the repository at this point in the history
Summary:
Very recently this catch was added to guard against instances which may yield a malformed json.

Unfortunately, the change requires a newer version of Folly which is not used in OSS.

Reviewed By: antonk52

Differential Revision: D55637338

fbshipit-source-id: 1a3ba3ce3c2bb8c9f93eddb069bfadd6b45cafe7
  • Loading branch information
lblasa authored and facebook-github-bot committed Apr 2, 2024
1 parent dd9815b commit c4a7b15
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions xplat/Flipper/FlipperConnectionManagerImpl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -330,8 +330,12 @@ void FlipperConnectionManagerImpl::sendMessage(const folly::dynamic& message) {
// Skip sending messages that are too large.
log(e.what());
return;
} catch (json::print_error& e) {
// Skip sending messages with invalid K/V
} catch (std::runtime_error& e) {
// Skip sending messages with invalid K/V.
// On newer versions of folly, this will throw a json::print_error.
// Because we are using an older version of folly, we need to catch
// the more generic std::runtime_error which is the base class for
// json::print_error.
log(e.what());
return;
}
Expand Down

0 comments on commit c4a7b15

Please sign in to comment.