Merge pull request #14260 from grafana/davkal/fix-14258

Explore: Show logging errors from backend
This commit is contained in:
David
2018-12-03 10:00:22 +01:00
committed by GitHub

View File

@@ -727,6 +727,9 @@ export class Explore extends React.PureComponent<ExploreProps, ExploreState> {
let error: string | JSX.Element = response;
if (response.data) {
if (typeof response.data === 'string') {
error = response.data;
} else if (response.data.error) {
error = response.data.error;
if (response.data.response) {
error = (
@@ -736,6 +739,9 @@ export class Explore extends React.PureComponent<ExploreProps, ExploreState> {
</>
);
}
} else {
throw new Error('Could not handle error response');
}
}
this.setState(state => {