From 92ae019f8e042b77c293b4f6d1cca57044717b2e Mon Sep 17 00:00:00 2001 From: Erik Sundell Date: Fri, 12 Feb 2021 15:49:33 +0100 Subject: [PATCH] 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 --- public/app/plugins/datasource/cloudwatch/datasource.ts | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/public/app/plugins/datasource/cloudwatch/datasource.ts b/public/app/plugins/datasource/cloudwatch/datasource.ts index 3f65353d34a..35124ab30aa 100644 --- a/public/app/plugins/datasource/cloudwatch/datasource.ts +++ b/public/app/plugins/datasource/cloudwatch/datasource.ts @@ -552,13 +552,7 @@ export class CloudWatchDatasource extends DataSourceApi ({ - 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) => {