Files
grafana/public/app/features/explore/Logs/utils/logsVolumeResponse.ts
Haris Rozajac 69c4da618c Explore: Reorganized data viz components (#68510)
* Move logs-related files to its own folder; update ownership paths

* Fix failing tests

* Put Flame graph and Node graph related files into separate folders

* Put RawPrometheus related files into a separate folder

* Put Table related files into a separate folder

* Add owners to three visualization categories

* observability-logs team owns everything under logs

* Move logs utils to their separate folder under Logs
2023-05-23 07:42:38 -06:00

19 lines
594 B
TypeScript

import { DataQueryError, DataQueryResponse } from '@grafana/data';
// Currently we can only infer if an error response is a timeout or not.
export function isTimeoutErrorResponse(response: DataQueryResponse | undefined): boolean {
if (!response) {
return false;
}
if (!response.error && !response.errors) {
return false;
}
const errors = response.error ? [response.error] : response.errors || [];
return errors.some((error: DataQueryError) => {
const message = `${error.message || error.data?.message}`?.toLowerCase();
return message.includes('timeout');
});
}