File tree Expand file tree Collapse file tree 8 files changed +97
-2
lines changed Expand file tree Collapse file tree 8 files changed +97
-2
lines changed Original file line number Diff line number Diff line change
1
+ // init error logging
2
+ import './services/sentry/init'
3
+
1
4
import Editor from './editor'
2
5
3
6
// vscode editor
Original file line number Diff line number Diff line change @@ -2,7 +2,7 @@ import * as sentry from '@sentry/node'
2
2
import { Scope } from '@sentry/hub'
3
3
import environment from '../../environment'
4
4
5
- const onError = error => {
5
+ const onError = ( error : Error ) => {
6
6
// set user scope https://docs.sentry.io/enriching-error-data/scopes/?platform=node
7
7
sentry . withScope ( ( scope : Scope ) => {
8
8
scope . setTag ( 'VERSION' , environment . VERSION )
Original file line number Diff line number Diff line change 29
29
"@alifd/theme-4" : " ^0.2.3" ,
30
30
"@apollo/react-hooks" : " ^3.1.3" ,
31
31
"@emotion/core" : " ^10.0.27" ,
32
+ "@sentry/browser" : " ^5.11.1" ,
32
33
"apollo-boost" : " ^0.4.7" ,
33
34
"graphql" : " ^14.5.8" ,
34
35
"markdown-it" : " ^10.0.0" ,
Original file line number Diff line number Diff line change 6
6
// }
7
7
// }
8
8
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'
10
11
export 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 1
1
import * as React from 'react'
2
2
import ReactDOM from 'react-dom'
3
3
import App from './App'
4
+
5
+ // init error logging
6
+ import './services/sentry/init'
7
+ // init initial styles
4
8
import './styles/index.css'
9
+ // init listeners
5
10
import './services/listeners'
6
11
7
12
ReactDOM . 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