From 44008445b8a177929fc7cbac535c88c842f4b60a Mon Sep 17 00:00:00 2001 From: "Grot (@grafanabot)" <43478413+grafanabot@users.noreply.github.com> Date: Tue, 16 Feb 2021 16:23:17 +0100 Subject: [PATCH] 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 92ae019f8e042b77c293b4f6d1cca57044717b2e) Co-authored-by: Erik Sundell --- 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) => {