Skip to content

Commit 0973c72

Browse files
authored
remove sentry (#2418)
1 parent 5f023fc commit 0973c72

File tree

7 files changed

+26
-124
lines changed

7 files changed

+26
-124
lines changed

package-lock.json

-57
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

-1
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,6 @@
8585
"@fortawesome/free-brands-svg-icons": "^5.6.1",
8686
"@fortawesome/react-fontawesome": "^0.1.3",
8787
"@portis/web3": "^2.0.0-beta.59",
88-
"@sentry/browser": "^5.0.8",
8988
"@toruslabs/torus-embed": "^1.3.0",
9089
"@walletconnect/web3-provider": "1.3.1",
9190
"axios": "^0.21.1",

src/@store/web3/web3Actions.ts

-7
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
import { getWeb3ProviderInfo, getProviderNetworkName } from "arc";
2-
import * as Sentry from "@sentry/browser";
32
import * as Redux from "redux";
43

54
import Analytics from "lib/analytics";
@@ -23,12 +22,6 @@ export function setCurrentAccount(accountAddress: string, network?: string) {
2322
};
2423
dispatch(action);
2524

26-
if (process.env.NODE_ENV === "production") {
27-
Sentry.configureScope((scope) => {
28-
scope.setUser({ id: accountAddress || "" });
29-
});
30-
}
31-
3225
// if the accountAddress is undefined, we are done
3326
if (accountAddress === undefined) {
3427
Analytics.reset();

src/components/Errors/Error404.tsx

+23-31
Original file line numberDiff line numberDiff line change
@@ -3,37 +3,29 @@ import { Link } from "react-router-dom";
33
import * as appCss from "../../layouts/App.scss";
44
import * as css from "./Errors.scss";
55

6-
export default class Error404 extends React.PureComponent {
7-
8-
constructor(props: any) {
9-
super(props);
10-
this.state = {
11-
sentryEventId: null,
12-
};
13-
}
14-
15-
render() {
16-
return (
17-
<div className={css.errorContainer}>
18-
<nav className={appCss.header}>
19-
<div>
20-
<div className={appCss.menu}>
21-
<Link to="/"><img src="/assets/images/alchemy-logo-white.svg"/></Link>
22-
</div>
23-
<div className={appCss.topInfo}>Alchemy</div>
24-
</div>
25-
</nav>
26-
<div className={css.content}>
27-
<div className={css.banner}>
28-
<img className={css.stars} src="/assets/images/Errors/stars-404.svg" />
29-
</div>
30-
<div className={css.title}>Are you lost?</div>
31-
<div className={css.description}>This URL seems wrong (probably a copy-paste error 😉)… Please check the url or contact support.</div>
32-
<div>
33-
<Link to="/"><button className={css.home}>Home</button></Link>
6+
const Error404 = () => {
7+
return (
8+
<div className={css.errorContainer}>
9+
<nav className={appCss.header}>
10+
<div>
11+
<div className={appCss.menu}>
12+
<Link to="/"><img src="/assets/images/alchemy-logo-white.svg" /></Link>
3413
</div>
14+
<div className={appCss.topInfo}>Alchemy</div>
15+
</div>
16+
</nav>
17+
<div className={css.content}>
18+
<div className={css.banner}>
19+
<img className={css.stars} src="/assets/images/Errors/stars-404.svg" />
20+
</div>
21+
<div className={css.title}>Are you lost?</div>
22+
<div className={css.description}>This URL seems wrong (probably a copy-paste error 😉)… Please check the url or contact support.</div>
23+
<div>
24+
<Link to="/"><button className={css.home}>Home</button></Link>
3525
</div>
3626
</div>
37-
);
38-
}
39-
}
27+
</div>
28+
);
29+
};
30+
31+
export default Error404;

src/components/Errors/ErrorUncaught.tsx

-6
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,14 @@
11
import * as React from "react";
2-
import { showReportDialog } from "@sentry/browser";
32
import { Link } from "react-router-dom";
43
import * as appCss from "../../layouts/App.scss";
54
import * as css from "./Errors.scss";
65

76
interface IExternalProps {
87
errorMessage: string;
9-
sentryEventId?: string;
108
goHome?: () => void;
119
}
1210

1311
export default class ErrorUncaught extends React.PureComponent<IExternalProps> {
14-
handleReport = () => {
15-
showReportDialog({ eventId: this.props.sentryEventId });
16-
}
1712

1813
render() {
1914
return (
@@ -37,7 +32,6 @@ export default class ErrorUncaught extends React.PureComponent<IExternalProps> {
3732
<div className={css.title}>Something went wrong…</div>
3833
<div className={css.description}>{this.props.errorMessage}</div>
3934
<div>
40-
{ this.props.sentryEventId ? <a className={css.report} onClick={this.handleReport}>Report</a> : "" }
4135
{ this.props.goHome ? <Link to="/"><button onClick={this.props.goHome} className={css.home}>Home</button></Link> : "" }
4236
</div>
4337
</div>

src/index.tsx

-8
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
import { library } from "@fortawesome/fontawesome-svg-core";
22
import { faGithub } from "@fortawesome/free-brands-svg-icons/faGithub";
33
import { faTwitter } from "@fortawesome/free-brands-svg-icons/faTwitter";
4-
import { init as sentryInit } from "@sentry/browser";
54
import * as Mixpanel from "mixpanel-browser";
65
import * as React from "react";
76
import { render } from "react-dom";
@@ -15,13 +14,6 @@ async function renderApp() {
1514
// Add icons we want to use from FontAwesome
1615
library.add(faGithub, faTwitter);
1716

18-
if (process.env.NODE_ENV === "production") {
19-
sentryInit({
20-
dsn: "https://[email protected]/1419793",
21-
environment: process.env.NODE_ENV,
22-
});
23-
}
24-
2517
if (process.env.MIXPANEL_TOKEN && (process.env.NODE_ENV === "production")) {
2618
Mixpanel.init(process.env.MIXPANEL_TOKEN);
2719
}

src/layouts/AppContainer.tsx

+3-14
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@ import { matchPath, Link, Route, RouteComponentProps, Switch } from "react-route
1818
import { ModalContainer } from "react-router-modal";
1919
import { History } from "history";
2020
import classNames from "classnames";
21-
import { captureException, withScope } from "@sentry/browser";
2221
import { Address } from "@daostack/arc.js";
2322
import { sortedNotifications } from "@store/notifications/notifications";
2423
import * as css from "./App.scss";
@@ -80,7 +79,6 @@ type IProps = IExternalProps & IStateProps & IDispatchProps;
8079

8180
interface IState {
8281
error: Error;
83-
sentryEventId: string;
8482
}
8583

8684
class AppContainer extends React.Component<IProps, IState> {
@@ -92,24 +90,15 @@ class AppContainer extends React.Component<IProps, IState> {
9290
super(props);
9391
this.state = {
9492
error: null,
95-
sentryEventId: null,
9693
};
9794
}
9895

9996
private showSimpleMessage = (options: ISimpleMessagePopupProps): void => {
10097
this.props.showSimpleMessage(options);
10198
}
10299

103-
public componentDidCatch(error: Error, errorInfo: any): void {
100+
public componentDidCatch(error: Error): void {
104101
this.setState({ error });
105-
106-
if (process.env.NODE_ENV === "production") {
107-
withScope((scope): void => {
108-
scope.setExtras(errorInfo);
109-
const sentryEventId = captureException(error);
110-
this.setState({ sentryEventId });
111-
});
112-
}
113102
}
114103

115104
public async componentDidMount(): Promise<void> {
@@ -180,7 +169,7 @@ class AppContainer extends React.Component<IProps, IState> {
180169
}
181170

182171
private clearError = () => {
183-
this.setState({ error: null, sentryEventId: null });
172+
this.setState({ error: null });
184173
}
185174

186175
private dismissNotif = (id: string) => () => this.props.dismissNotification(id);
@@ -224,7 +213,7 @@ class AppContainer extends React.Component<IProps, IState> {
224213
// eslint-disable-next-line no-console
225214
console.error(this.state.error);
226215
return <div>
227-
<ErrorUncaught errorMessage={this.state.error.message} sentryEventId={this.state.sentryEventId} goHome={this.clearError}></ErrorUncaught>
216+
<ErrorUncaught errorMessage={this.state.error.message} goHome={this.clearError}></ErrorUncaught>
228217
</div>;
229218
} else {
230219
const hasAcceptedCookies = !!localStorage.getItem(AppContainer.hasAcceptedCookiesKey);

0 commit comments

Comments
 (0)