1import { useMemo } from 'react';
2import newGithubIssueUrl from 'new-github-issue-url';
3import { OutButton, RestartButton } from './Buttons';
4import { versionLabel } from 'lib/flags';
6const buildTitle = (error: Error) => `Error Report: ${error.message}`;
8const buildBody = (error: Error) => `\n
9<!-- Thanks for submitting this error! Can you help us identify the issue by providing additional context? -->
13<!-- 1) What were you doing when you encountered this error? -->
15<!-- 2) If you're comfortable sharing (don't self-dox!), what Ethereum address were you logged in with? -->
22In Bridge version ${versionLabel}.\n
26 * NOTE: we want to use as few normal components here as possible, since the
27 * error might have originated from within those components, making this
28 * whole error boundary useless.
31interface GlobalErrorBoundaryProps {
35export default function GlobalErrorBoundary({
37}: GlobalErrorBoundaryProps) {
43 labels: ['bug', 'error handling'],
44 title: buildTitle(error),
45 body: buildBody(error),
51 <div className="mw1 ph4">
54 <span role="img" aria-label="a bridge on fire">
58 <p className="mt4 f5">
59 We caught an error thrown by the Bridge application client-side code.
61 <b>Your points and assets are most likely safe.</b>
64 If you'd like to help us make Bridge better, you can submit the error
65 and your description of events to our GitHub issue tracker.
67 <OutButton href={url} solid>
68 Submit the Issue on GitHub
70 <pre className="bg-gray1 mt4 p4 mono scroll-x">{error.stack}</pre>
72 You can reload Bridge and retry the operation that caused an error. If
73 the error persists, please submit a bug report and we'll work with you
76 <RestartButton onClick={() => document.location.reload()} solid success>
keysesc to close
- j k
- move down, up
- enter
- open
- esc
- back, or up a level
- 1 2 3 4
- readme, files, commits, refs
- /
- filter
- y
- copy the clone command
- c
- compare the chosen commit with another (or shift-click both)
- ?
- show or hide this list