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

* ensure empty errors are not passed to the panel

* make it a oneliner

(cherry picked from commit 92ae019f8e)

Co-authored-by: Erik Sundell <erik.sundell@grafana.com>
This commit is contained in:
Grot (@grafanabot)andErik Sundell authored and GitHub committed 2021-02-16 16:23:17 +01:00
1 parent 65d8420007
commit 44008445b8
1 file changed
+1 -7
@@ -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) => {