Skip to content

Commit 9b2f5b1

Browse files
committed
Fixed charts error display.
1 parent eee9be1 commit 9b2f5b1

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

src/components/views/charts/Chart.js

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,8 @@ export default class Chart extends React.Component {
7373
let urlparams = ''//?token='+localStorage.token
7474

7575
if(fid){
76-
axios.get(apiPath+''+e+'/chart/'+fid+urlparams)
76+
const url = apiPath+''+e+'/chart/'+fid+urlparams
77+
axios.get(url)
7778
.then(response => {
7879
if(!this.done){
7980
this.setState({
@@ -84,11 +85,11 @@ export default class Chart extends React.Component {
8485
})
8586
.catch((err) => {
8687
if(!this.done){
88+
console.error(err)
8789
this.setState({
8890
error: {
8991
title: 'Server error',
90-
message: err.response.statusText ||
91-
'Couldn\'t retrieve charts data for field "'+fid+'".'
92+
message: 'Couldn\'t retrieve charts data for field "'+fid+'" at '+url+'.'
9293
},
9394
loading: false,
9495
})

0 commit comments

Comments
 (0)