Commit 92ae019f by Erik Sundell Committed by GitHub

CloudWatch: Ensure empty query row errors are not passed to the panel (#31172)

* ensure empty errors are not passed to the panel

* make it a oneliner
parent 45cf342b
...@@ -552,13 +552,7 @@ export class CloudWatchDatasource extends DataSourceApi<CloudWatchQuery, CloudWa ...@@ -552,13 +552,7 @@ export class CloudWatchDatasource extends DataSourceApi<CloudWatchQuery, CloudWa
return { return {
data: dataframes, data: dataframes,
error: Object.values(res.results) error: Object.values(res.results).reduce((acc, curr) => (curr.error ? { message: curr.error } : acc), null),
.map((o) => ({
message: o.error,
}))
.reduce((err, error) => {
return err || error;
}, null),
}; };
}), }),
catchError((err) => { catchError((err) => {
......
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