import React, { useMemo } from 'react'; import newGithubIssueUrl from 'new-github-issue-url'; import { OutButton, RestartButton } from './Buttons'; import { version } from '../../package.json'; const buildTitle = error => `Error Report: ${error.message}`; const buildBody = error => `\n \n ## Context \n \n \n ## Error\n\n \`\`\` ${error.stack} \`\`\` \n In Bridge version ${version}.\n `; /** * NOTE: we want to use as few normal components here as possible, since the * error might have originated from within those components, making this * whole error boundary useless. */ export default function GlobalErrorBoundary({ error }) { const url = useMemo( () => newGithubIssueUrl({ user: 'urbit', repo: 'bridge', labels: ['bug', 'error handling'], title: buildTitle(error), body: buildBody(error), }), [error] ); return (
We caught an error thrown by the Bridge application client-side code.
Your points and assets are most likely safe.
If you'd like to help us make Bridge better, you can submit the error and your description of events to our GitHub issue tracker.
{error.stack}
You can reload Bridge and retry the operation that caused an error. If the error persists, please submit a bug report and we'll work with you to resolve it!