Commit 940dda6c by Torkel Ödegaard Committed by GitHub

Merge pull request #14369 from grafana/davkal/explore-error-handling

Explore: improve error handling
parents 093c9425 15eb3bb2
......@@ -735,7 +735,7 @@ export class Explore extends React.PureComponent<ExploreProps, ExploreState> {
console.error(response);
let error: string | JSX.Element = response;
let error: string | JSX.Element;
if (response.data) {
if (typeof response.data === 'string') {
error = response.data;
......@@ -752,6 +752,12 @@ export class Explore extends React.PureComponent<ExploreProps, ExploreState> {
} else {
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 => {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment