File tree Expand file tree Collapse file tree 8 files changed +97
-2
lines changed Top Open diff view settings Expand file tree Collapse file tree 8 files changed +97
-2
lines changed Top Open diff view settings Original file line number Diff line number Diff line change 1+ // init error logging
2+ import './services/sentry/init'
3+
14import Editor from './editor'
25
36// vscode editor
Original file line number Diff line number Diff line change @@ -2,7 +2,7 @@ import * as sentry from '@sentry/node'
22import { Scope } from '@sentry/hub'
33import environment from '../../environment'
44
5- const onError = error => {
5+ const onError = ( error : Error ) => {
66 // set user scope https://docs.sentry.io/enriching-error-data/scopes/?platform=node
77 sentry . withScope ( ( scope : Scope ) => {
88 scope . setTag ( 'VERSION' , environment . VERSION )
Original file line number Diff line number Diff line change 2929 "@alifd/theme-4" : " ^0.2.3" ,
3030 "@apollo/react-hooks" : " ^3.1.3" ,
3131 "@emotion/core" : " ^10.0.27" ,
32+ "@sentry/browser" : " ^5.11.1" ,
3233 "apollo-boost" : " ^0.4.7" ,
3334 "graphql" : " ^14.5.8" ,
3435 "markdown-it" : " ^10.0.0" ,
Original file line number Diff line number Diff line change 66// }
77// }
88
9- export const GQL_URI : string = process . env . REACT_APP_GQL_URI || 'https://33mf420q4m.execute-api.us-west-2.amazonaws.com/stage/api-stage'
9+ export const GQL_URI : string =
10+ process . env . REACT_APP_GQL_URI || 'https://33mf420q4m.execute-api.us-west-2.amazonaws.com/stage/api-stage'
1011export const DEBUG : boolean = ( process . env . REACT_APP_DEBUG || '' ) . toLowerCase ( ) === 'true'
12+ export const VERSION : string = process . env . VERSION || 'unknown'
13+ export const NODE_ENV : string = process . env . NODE_ENV || 'producton'
Original file line number Diff line number Diff line change 11import * as React from 'react'
22import ReactDOM from 'react-dom'
33import App from './App'
4+
5+ // init error logging
6+ import './services/sentry/init'
7+ // init initial styles
48import './styles/index.css'
9+ // init listeners
510import './services/listeners'
611
712ReactDOM . render ( < App /> , document . getElementById ( 'root' ) as HTMLElement )
Original file line number Diff line number Diff line change 1+ import * as sentry from '@sentry/browser'
2+ import { NODE_ENV } from '../../environment'
3+
4+ sentry . init ( {
5+ dsn : 'https://701cee76c32a4408b2fcb6af3e139d46@sentry.io/1889371' ,
6+ environment : NODE_ENV ,
7+ } )
Original file line number Diff line number Diff line change 1+ import * as sentry from '@sentry/node'
2+ import { Scope } from '@sentry/hub'
3+ import { VERSION } from '../../environment'
4+
5+ const onError = ( error : Error ) => {
6+ // set user scope https://docs.sentry.io/enriching-error-data/scopes/?platform=node
7+ sentry . withScope ( ( scope : Scope ) => {
8+ scope . setTag ( 'VERSION' , VERSION )
9+ // if (user) {
10+ // scope.setUser({
11+ // id: user.id,
12+ // email: user.email || 'unknown',
13+ // })
14+ // }
15+ sentry . captureException ( error )
16+ } )
17+ }
18+
19+ export default onError
You can’t perform that action at this time.
0 commit comments