diff --git a/public/app/features/explore/Explore.tsx b/public/app/features/explore/Explore.tsx index 5926ee59612..019cdef3353 100644 --- a/public/app/features/explore/Explore.tsx +++ b/public/app/features/explore/Explore.tsx @@ -727,14 +727,20 @@ export class Explore extends React.PureComponent { let error: string | JSX.Element = response; if (response.data) { - error = response.data.error; - if (response.data.response) { - error = ( - <> - {response.data.error} -
{response.data.response}
- - ); + if (typeof response.data === 'string') { + error = response.data; + } else if (response.data.error) { + error = response.data.error; + if (response.data.response) { + error = ( + <> + {response.data.error} +
{response.data.response}
+ + ); + } + } else { + throw new Error('Could not handle error response'); } }