diff options
Diffstat (limited to 'app/javascript/mastodon/components/error_boundary.js')
-rw-r--r-- | app/javascript/mastodon/components/error_boundary.js | 25 |
1 files changed, 3 insertions, 22 deletions
diff --git a/app/javascript/mastodon/components/error_boundary.js b/app/javascript/mastodon/components/error_boundary.js index ca3012276..4e1c882e2 100644 --- a/app/javascript/mastodon/components/error_boundary.js +++ b/app/javascript/mastodon/components/error_boundary.js @@ -2,7 +2,6 @@ import React from 'react'; import PropTypes from 'prop-types'; import { FormattedMessage } from 'react-intl'; import { version, source_url } from 'mastodon/initial_state'; -import StackTrace from 'stacktrace-js'; export default class ErrorBoundary extends React.PureComponent { @@ -12,42 +11,24 @@ 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, - }); + copied: false, }); } handleCopyStackTrace = () => { - const { errorMessage, stackTrace, mappedStackTrace } = this.state; + const { stackTrace } = this.state; const textarea = document.createElement('textarea'); - let contents = [errorMessage, stackTrace]; - if (mappedStackTrace) { - contents.push(mappedStackTrace); - } - - textarea.textContent = contents.join('\n\n\n'); + textarea.textContent = stackTrace; textarea.style.position = 'fixed'; document.body.appendChild(textarea); |