1import React, { useMemo } from 'react';
2import newGithubIssueUrl from 'new-github-issue-url';
3import { OutButton, RestartButton } from './Buttons';
4import { versionLabel } from 'lib/flags';
6const buildTitle = error => `Error Report: ${error.message}`;
8const buildBody = 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.
30export default function GlobalErrorBoundary({ error }) {
36 labels: ['bug', 'error handling'],
37 title: buildTitle(error),
38 body: buildBody(error),
44 <div className="mw1 ph4">
47 <span role="img" aria-label="a bridge on fire">
51 <p className="mt4 f5">
52 We caught an error thrown by the Bridge application client-side code.
54 <b>Your points and assets are most likely safe.</b>
57 If you'd like to help us make Bridge better, you can submit the error
58 and your description of events to our GitHub issue tracker.
60 <OutButton href={url} solid>
61 Submit the Issue on GitHub
63 <pre className="bg-gray1 mt4 p4 mono scroll-x">{error.stack}</pre>
65 You can reload Bridge and retry the operation that caused an error. If
66 the error persists, please submit a bug report and we'll work with you
69 <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