Parcourir la source

Trace errors by using sentry.io

afc163 il y a 8 ans
Parent
commit
b8a96c5b85
3 fichiers modifiés avec 8 ajouts et 0 suppressions
  1. 1 0
      package.json
  2. 1 0
      src/index.js
  3. 6 0
      src/raven.js

+ 1 - 0
package.json

@@ -67,6 +67,7 @@
     "lint-staged": "^4.3.0",
     "mockjs": "^1.0.1-beta3",
     "pro-download": "^1.0.0",
+    "raven-js": "^3.20.1",
     "react-test-renderer": "^16.0.0",
     "redbox-react": "^1.3.2",
     "roadhog": "^1.3.1",

+ 1 - 0
src/index.js

@@ -2,6 +2,7 @@ import dva from 'dva';
 import 'moment/locale/zh-cn';
 import './polyfill';
 import './g2';
+import './raven';
 // import { browserHistory } from 'dva/router';
 import './index.less';
 

+ 6 - 0
src/raven.js

@@ -0,0 +1,6 @@
+import Raven from 'raven-js';
+
+// Track error by https://sentry.io/
+if (location.host === 'preview.pro.ant.design') {
+  Raven.config('https://969e74e863854cf0ae7d7d72f534bd3e@sentry.io/247221').install();
+}