mirror of
https://github.com/grafana/grafana.git
synced 2025-07-30 20:32:24 +08:00
Variable: Inform users of the error details when Grafana is unable to retrieve the variable values from an SQL data source. (#82222)
* feat: Inform users of the error details when Grafana is unable to retrieve the variable values from an SQL data source. * format code * use getAppEvents * throw an error when failing to executing the sql query * optimize code * prettier
This commit is contained in:
@ -208,7 +208,13 @@ export abstract class SqlDatasource extends DataSourceWithBackend<SQLQuery, SQLO
|
||||
format: QueryFormat.Table,
|
||||
};
|
||||
|
||||
const response = await this.runMetaQuery(interpolatedQuery, range);
|
||||
let response;
|
||||
try {
|
||||
response = await this.runMetaQuery(interpolatedQuery, range);
|
||||
} catch (error) {
|
||||
console.error(error);
|
||||
throw new Error('error when executing the sql query');
|
||||
}
|
||||
return this.getResponseParser().transformMetricFindResponse(response);
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user