Show uncatched errors to developers

Summary: To make (accidental) errors more visible to developers of Flipper, all uncaught and FBLogger logged errors will be shown in the UI and prefixed with `[DEV]`. This is only done in non-production builds

Reviewed By: jknoxville

Differential Revision: D18061174

fbshipit-source-id: 9dab0e8d34396b0cb421a4d4e6fc14c81447d190
This commit is contained in:
Michel Weststrate
2019-10-23 04:14:55 -07:00
committed by Facebook Github Bot
parent beb797e70d
commit 40bc957b21
2 changed files with 4 additions and 0 deletions

View File

@@ -101,6 +101,7 @@ function init() {
initLauncherHooks(config(), store); initLauncherHooks(config(), store);
const sessionId = store.getState().application.sessionId; const sessionId = store.getState().application.sessionId;
initCrashReporter(sessionId || ''); initCrashReporter(sessionId || '');
window.flipperGlobalStoreDispatch = store.dispatch;
} }
// rehydrate app state before exposing init // rehydrate app state before exposing init

View File

@@ -9,6 +9,7 @@
import {StoreEnhancerStoreCreator} from 'redux'; import {StoreEnhancerStoreCreator} from 'redux';
import {ResizeObserver} from './ResizeObserver.d'; import {ResizeObserver} from './ResizeObserver.d';
import {Store} from '../src/reducers';
export {}; export {};
type RequestIdleHandle = number; type RequestIdleHandle = number;
@@ -19,6 +20,8 @@ declare global {
} }
interface Window { interface Window {
flipperGlobalStoreDispatch: Store['dispatch'];
__REDUX_DEVTOOLS_EXTENSION__: __REDUX_DEVTOOLS_EXTENSION__:
| undefined | undefined
| StoreEnhancerStoreCreator & StoreEnhancerStateSanitizer; | StoreEnhancerStoreCreator & StoreEnhancerStateSanitizer;