From 4288a7cfd5aba6da3b24343340df3c33fa8ee057 Mon Sep 17 00:00:00 2001 From: Pritesh Nandgaonkar Date: Fri, 1 Feb 2019 11:02:17 -0800 Subject: [PATCH] send flipper cpp errors only in non-prod builds Summary: This diff makes sure that flipper error notifications are triggered only on the non-prod builds. Ideally we should have a preference in the flipper app itself, this we can work out later. As this diff solves the issue posted in the [group](https://fb.workplace.com/groups/230455004101832/permalink/561100837703912/). Reviewed By: passy Differential Revision: D13923819 fbshipit-source-id: 6598f00ab3a7b0c4a3b783120e62a1796fe4e5d2 --- src/Client.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/Client.js b/src/Client.js index 2aea2afb6..594fce0cb 100644 --- a/src/Client.js +++ b/src/Client.js @@ -17,6 +17,7 @@ import {ReactiveSocket, PartialResponder} from 'rsocket-core'; // $FlowFixMe perf_hooks is a new API in node import {performance} from 'perf_hooks'; import {reportPluginFailures} from './utils/metrics'; +import {default as isProduction} from './utils/isProduction.js'; const EventEmitter = (require('events'): any); const invariant = require('invariant'); @@ -39,6 +40,9 @@ type ErrorType = {message: string, stacktrace: string, name: string}; type RequestMetadata = {method: string, id: number, params: ?Object}; const handleError = (store: Store, deviceSerial: ?string, error: ErrorType) => { + if (isProduction()) { + return; + } const crashReporterPlugin = store .getState() .plugins.devicePlugins.get('CrashReporter');