diff --git a/src/Client.js b/src/Client.js index 77359bba2..f5b935fdd 100644 --- a/src/Client.js +++ b/src/Client.js @@ -57,15 +57,22 @@ const handleError = (store: Store, deviceSerial: ?string, error: ErrorType) => { ...crashReporterPlugin.defaultPersistedState, ...store.getState().pluginStates[pluginKey], }; + const isCrashReport: boolean = Boolean(error.name || error.message); + const payload = isCrashReport + ? { + name: error.name, + reason: error.message, + callstack: error.stacktrace, + } + : { + name: 'Plugin Error', + reason: JSON.stringify(error), + }; // $FlowFixMe: We checked persistedStateReducer exists const newPluginState = crashReporterPlugin.persistedStateReducer( persistedState, 'flipper-crash-report', - { - name: error.name, - reason: error.message, - callstack: error.stacktrace, - }, + payload, ); if (persistedState !== newPluginState) { store.dispatch( diff --git a/src/plugins/layout/layout2/index.js b/src/plugins/layout/layout2/index.js index 26eb20267..05d3f8379 100644 --- a/src/plugins/layout/layout2/index.js +++ b/src/plugins/layout/layout2/index.js @@ -16,6 +16,7 @@ import { Link, Glyph, DetailSidebar, + SidebarExtensions, } from 'flipper'; import Inspector from './Inspector'; import ToolbarIcon from './ToolbarIcon'; @@ -193,6 +194,7 @@ export default class Layout extends FlipperPlugin { element={element} onValueChanged={this.onDataValueChanged} logger={this.props.logger} + extensions={SidebarExtensions} />