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
This commit is contained in:
committed by
Facebook Github Bot
parent
09a93cd9e6
commit
4288a7cfd5
@@ -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');
|
||||
|
||||
Reference in New Issue
Block a user