Commit ba18b470 by David Committed by GitHub

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

Explore: Show logging errors from backend
parents 3c8515bb 47468fca
......@@ -727,14 +727,20 @@ export class Explore extends React.PureComponent<ExploreProps, ExploreState> {
let error: string | JSX.Element = response;
if (response.data) {
error = response.data.error;
if (response.data.response) {
error = (
<>
<span>{response.data.error}</span>
<details>{response.data.response}</details>
</>
);
if (typeof response.data === 'string') {
error = response.data;
} else if (response.data.error) {
error = response.data.error;
if (response.data.response) {
error = (
<>
<span>{response.data.error}</span>
<details>{response.data.response}</details>
</>
);
}
} else {
throw new Error('Could not handle error response');
}
}
......
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