Add raven to frontend
This commit is contained in:
parent
9f2b21574b
commit
d6026330de
|
@ -12,6 +12,7 @@
|
||||||
"d3.chart.sankey": "^0.4.0",
|
"d3.chart.sankey": "^0.4.0",
|
||||||
"lodash": "^4.17.11",
|
"lodash": "^4.17.11",
|
||||||
"material-design-icons-iconfont": "^3.0.3",
|
"material-design-icons-iconfont": "^3.0.3",
|
||||||
|
"raven-js": "^3.27.0",
|
||||||
"roboto-fontface": "*",
|
"roboto-fontface": "*",
|
||||||
"vue": "^2.6.6",
|
"vue": "^2.6.6",
|
||||||
"vue-router": "^3.0.2",
|
"vue-router": "^3.0.2",
|
||||||
|
|
|
@ -1,5 +1,9 @@
|
||||||
import Axios from 'axios';
|
import Axios from 'axios';
|
||||||
import Vue from 'vue';
|
import Vue from 'vue';
|
||||||
|
import Raven from 'raven-js';
|
||||||
|
import RavenVue from 'raven-js/plugins/vue';
|
||||||
|
|
||||||
|
|
||||||
import './plugins/vuetify';
|
import './plugins/vuetify';
|
||||||
|
|
||||||
import App from './components/app.vue';
|
import App from './components/app.vue';
|
||||||
|
@ -23,14 +27,13 @@ const configureHttp = () => {
|
||||||
},
|
},
|
||||||
(error) => {
|
(error) => {
|
||||||
if (error.response && error.response.status === 401) {
|
if (error.response && error.response.status === 401) {
|
||||||
AuthController.refreshToken().catch(() => {
|
AuthController.refreshToken().then(() => {
|
||||||
|
router.push({ path: router.currentRoute.path });
|
||||||
|
}).catch(() => {
|
||||||
router.push({
|
router.push({
|
||||||
name: 'logout',
|
name: 'logout',
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
// router.push({
|
|
||||||
// name: 'logout',
|
|
||||||
// });
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return Promise.reject(error);
|
return Promise.reject(error);
|
||||||
|
@ -38,8 +41,17 @@ const configureHttp = () => {
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
const configureRaven = () => {
|
||||||
|
if (config.getEnv() !== 'dev') {
|
||||||
|
Raven
|
||||||
|
.config('https://2b1b0eea285244289175e53d65421fac@sentry.theedgeofrage.com/3')
|
||||||
|
.addPlugin(RavenVue, Vue)
|
||||||
|
.install();
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
configureHttp();
|
configureHttp();
|
||||||
AuthController.setupToken();
|
configureRaven();
|
||||||
|
|
||||||
new Vue({
|
new Vue({
|
||||||
router,
|
router,
|
||||||
|
|
|
@ -5614,6 +5614,11 @@ range-parser@^1.0.3, range-parser@~1.2.0:
|
||||||
resolved "https://registry.yarnpkg.com/range-parser/-/range-parser-1.2.0.tgz#f49be6b487894ddc40dcc94a322f611092e00d5e"
|
resolved "https://registry.yarnpkg.com/range-parser/-/range-parser-1.2.0.tgz#f49be6b487894ddc40dcc94a322f611092e00d5e"
|
||||||
integrity sha1-9JvmtIeJTdxA3MlKMi9hEJLgDV4=
|
integrity sha1-9JvmtIeJTdxA3MlKMi9hEJLgDV4=
|
||||||
|
|
||||||
|
raven-js@^3.27.0:
|
||||||
|
version "3.27.0"
|
||||||
|
resolved "https://registry.yarnpkg.com/raven-js/-/raven-js-3.27.0.tgz#9f47c03e17933ce756e189f3669d49c441c1ba6e"
|
||||||
|
integrity sha512-vChdOL+yzecfnGA+B5EhEZkJ3kY3KlMzxEhShKh6Vdtooyl0yZfYNFQfYzgMf2v4pyQa+OTZ5esTxxgOOZDHqw==
|
||||||
|
|
||||||
raw-body@2.3.3:
|
raw-body@2.3.3:
|
||||||
version "2.3.3"
|
version "2.3.3"
|
||||||
resolved "https://registry.yarnpkg.com/raw-body/-/raw-body-2.3.3.tgz#1b324ece6b5706e153855bc1148c65bb7f6ea0c3"
|
resolved "https://registry.yarnpkg.com/raw-body/-/raw-body-2.3.3.tgz#1b324ece6b5706e153855bc1148c65bb7f6ea0c3"
|
||||||
|
|
Reference in New Issue