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
return {
data: dataframes,
error: Object.values(res.results)
.map((o) => ({
message: o.error,
}))
.reduce((err, error) => {
return err || error;
}, null),
error: Object.values(res.results).reduce((acc, curr) => (curr.error ? { message: curr.error } : acc), null),
};
}),
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