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 <rsocket/RSocketResponder.h>
|
||||||
#include "FlipperConnectionManager.h"
|
#include "FlipperConnectionManager.h"
|
||||||
#include "FlipperResponder.h"
|
#include "FlipperResponder.h"
|
||||||
|
#include "Log.h"
|
||||||
|
|
||||||
namespace facebook {
|
namespace facebook {
|
||||||
namespace flipper {
|
namespace flipper {
|
||||||
@@ -38,8 +39,16 @@ class FlipperResponderImpl : public FlipperResponder {
|
|||||||
|
|
||||||
~FlipperResponderImpl() {
|
~FlipperResponderImpl() {
|
||||||
if (!isCompleted) {
|
if (!isCompleted) {
|
||||||
downstreamObserver_->onSuccess(
|
try {
|
||||||
folly::dynamic::object("success", folly::dynamic::object()));
|
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