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
pull/31178/head
Erik Sundell 4 years ago committed by GitHub
parent 45cf342b0d
commit 92ae019f8e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 8
      public/app/plugins/datasource/cloudwatch/datasource.ts

@ -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) => {

Loading…
Cancel
Save