mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
Explore: improve error handling
This commit is contained in:
parent
9a06fad24d
commit
15eb3bb2f8
@ -735,7 +735,7 @@ export class Explore extends React.PureComponent<ExploreProps, ExploreState> {
|
|||||||
|
|
||||||
console.error(response);
|
console.error(response);
|
||||||
|
|
||||||
let error: string | JSX.Element = response;
|
let error: string | JSX.Element;
|
||||||
if (response.data) {
|
if (response.data) {
|
||||||
if (typeof response.data === 'string') {
|
if (typeof response.data === 'string') {
|
||||||
error = response.data;
|
error = response.data;
|
||||||
@ -752,6 +752,12 @@ export class Explore extends React.PureComponent<ExploreProps, ExploreState> {
|
|||||||
} else {
|
} else {
|
||||||
throw new Error('Could not handle error response');
|
throw new Error('Could not handle error response');
|
||||||
}
|
}
|
||||||
|
} else if (response.message) {
|
||||||
|
error = response.message;
|
||||||
|
} else if (typeof response === 'string') {
|
||||||
|
error = response;
|
||||||
|
} else {
|
||||||
|
error = 'Unknown error during query transaction. Please check JS console logs.';
|
||||||
}
|
}
|
||||||
|
|
||||||
this.setState(state => {
|
this.setState(state => {
|
||||||
|
Loading…
Reference in New Issue
Block a user