From b8a96c5b853dc6aca16ec462655a875914292ddb Mon Sep 17 00:00:00 2001 From: afc163 Date: Sat, 18 Nov 2017 17:27:18 +0800 Subject: [PATCH] Trace errors by using sentry.io --- package.json | 1 + src/index.js | 1 + src/raven.js | 6 ++++++ 3 files changed, 8 insertions(+) create mode 100644 src/raven.js diff --git a/package.json b/package.json index 6099c60e..2632343e 100755 --- a/package.json +++ b/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", diff --git a/src/index.js b/src/index.js index d2dd78cd..fd0de02b 100644 --- a/src/index.js +++ b/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'; diff --git a/src/raven.js b/src/raven.js new file mode 100644 index 00000000..2f51aab7 --- /dev/null +++ b/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(); +} -- GitLab