diff options
author | Starfall <root@starfall.blue> | 2020-03-01 14:49:21 -0600 |
---|---|---|
committer | Starfall <root@starfall.blue> | 2020-03-01 14:49:21 -0600 |
commit | 12d35783db1bb302d7540d8d3690ab6eed3dac3b (patch) | |
tree | 66f1db08a2f6f9ae2254ba7a81b71835039d671e /app/javascript/flavours/glitch/components | |
parent | 22a55edc158352003a3953964c9d332a60c86428 (diff) |
Revert "Merge branch 'glitch'"
Login is broken This reverts commit 22a55edc158352003a3953964c9d332a60c86428, reversing changes made to 5902299384d15249fe4b84b8761d4a49f3c7f6fd.
Diffstat (limited to 'app/javascript/flavours/glitch/components')
-rw-r--r-- | app/javascript/flavours/glitch/components/error_boundary.js | 22 |
1 files changed, 2 insertions, 20 deletions
diff --git a/app/javascript/flavours/glitch/components/error_boundary.js b/app/javascript/flavours/glitch/components/error_boundary.js index 8998802b1..62950a7d3 100644 --- a/app/javascript/flavours/glitch/components/error_boundary.js +++ b/app/javascript/flavours/glitch/components/error_boundary.js @@ -2,7 +2,6 @@ import React from 'react'; import PropTypes from 'prop-types'; import { FormattedMessage } from 'react-intl'; import { preferencesLink } from 'flavours/glitch/util/backend_links'; -import StackTrace from 'stacktrace-js'; export default class ErrorBoundary extends React.PureComponent { @@ -12,29 +11,15 @@ export default class ErrorBoundary extends React.PureComponent { state = { hasError: false, - errorMessage: undefined, stackTrace: undefined, - mappedStackTrace: undefined, componentStack: undefined, } componentDidCatch(error, info) { this.setState({ hasError: true, - errorMessage: error.toString(), stackTrace: error.stack, componentStack: info && info.componentStack, - mappedStackTrace: undefined, - }); - - StackTrace.fromError(error).then((stackframes) => { - this.setState({ - mappedStackTrace: stackframes.map((sf) => sf.toString()).join('\n'), - }); - }).catch(() => { - this.setState({ - mappedStackTrace: undefined, - }); }); } @@ -44,16 +29,13 @@ export default class ErrorBoundary extends React.PureComponent { } render() { - const { hasError, errorMessage, stackTrace, mappedStackTrace, componentStack } = this.state; + const { hasError, stackTrace, componentStack } = this.state; if (!hasError) return this.props.children; let debugInfo = ''; if (stackTrace) { - debugInfo += 'Stack trace\n-----------\n\n```\n' + errorMessage + '\n' + stackTrace.toString() + '\n```'; - } - if (mappedStackTrace) { - debugInfo += 'Mapped stack trace\n-----------\n\n```\n' + errorMessage + '\n' + mappedStackTrace.toString() + '\n```'; + debugInfo += 'Stack trace\n-----------\n\n```\n' + stackTrace.toString() + '\n```'; } if (componentStack) { if (debugInfo) { |