Don't throw when reporting network request

Summary: Flipper should never crash the mobile app. This is a plugin entry point, so it's understandable that it can, but we should avoid it whenever possible.

Reviewed By: passy

Differential Revision: D20648373

fbshipit-source-id: f32b428cccdd0c78eb15e9e95a64ecf3f4e10429
This commit is contained in:
John Knox
2020-03-25 17:35:28 -07:00
committed by Facebook GitHub Bot
parent 39f0e0445e
commit a30d5f3e60

View File

@@ -34,7 +34,10 @@ public class NetworkFlipperPlugin extends BufferingFlipperPlugin implements Netw
}
@Override
public void reportRequest(RequestInfo requestInfo) {
public void reportRequest(final RequestInfo requestInfo) {
(new ErrorReportingRunnable(getConnection()) {
@Override
protected void runOrThrow() throws Exception {
final FlipperObject request =
new FlipperObject.Builder()
.put("id", requestInfo.requestId)
@@ -47,6 +50,9 @@ public class NetworkFlipperPlugin extends BufferingFlipperPlugin implements Netw
send("newRequest", request);
}
})
.run();
}
@Override
public void reportResponse(final ResponseInfo responseInfo) {