Initialize extra report property (#9033)

The `extra` property of errors sent to Sentry is sometimes not
initialized when we add the application state. A check has been added
to initialize it if it's missing.

I suspect that this changed with v5 of `@sentry/browser`, though I
can't find any explicit confirmation of this in their changelog.
feature/default_network_editable
Mark Stacey 4 years ago committed by GitHub
parent ea8fa580be
commit 4d66223f5c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 3
      app/scripts/lib/setupSentry.js

@ -101,6 +101,9 @@ export default function setupSentry ({ release, getState }) {
// append app state // append app state
if (getState) { if (getState) {
const appState = getState() const appState = getState()
if (!report.extra) {
report.extra = {}
}
report.extra.appState = appState report.extra.appState = appState
} }
} catch (err) { } catch (err) {

Loading…
Cancel
Save