Catch all throwables in FlipperResponder destructor
Summary: Exceptions should never be thrown from destructors, because if an exception is already propogating at the time the destructor is called. Program will terminate. Reviewed By: passy Differential Revision: D14123526 fbshipit-source-id: 15ff74f4f14eb28a586055e1b1a5d54231b549da
This commit is contained in:
committed by
Facebook Github Bot
parent
84240ede4e
commit
f8ff6fe1b2
@@ -11,6 +11,7 @@
|
||||
#include <rsocket/RSocketResponder.h>
|
||||
#include "FlipperConnectionManager.h"
|
||||
#include "FlipperResponder.h"
|
||||
#include "Log.h"
|
||||
|
||||
namespace facebook {
|
||||
namespace flipper {
|
||||
@@ -38,8 +39,16 @@ class FlipperResponderImpl : public FlipperResponder {
|
||||
|
||||
~FlipperResponderImpl() {
|
||||
if (!isCompleted) {
|
||||
try {
|
||||
downstreamObserver_->onSuccess(
|
||||
folly::dynamic::object("success", folly::dynamic::object()));
|
||||
} catch (std::exception& e) {
|
||||
log(std::string(
|
||||
"Exception occurred when responding in FlipperResponder: ") +
|
||||
e.what());
|
||||
} catch (...) {
|
||||
log("Exception occurred when responding in FlipperResponder");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user