From 2ee831969d2e7b6b1b5c53abab90ccbd1ccced57 Mon Sep 17 00:00:00 2001 From: "Grot (@grafanabot)" <43478413+grafanabot@users.noreply.github.com> Date: Fri, 6 Aug 2021 21:16:40 +0100 Subject: [PATCH] CloudWatch Logs: Fix crash when no region is configured (#37639) (#37646) (cherry picked from commit e9c032f10fe5461afe03c65bb159d2ee0ca96af1) Co-authored-by: Andrej Ocenas --- .../cloudwatch/components/LogsQueryField.tsx | 10 +++++++++- public/app/plugins/datasource/cloudwatch/datasource.ts | 3 +++ 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/public/app/plugins/datasource/cloudwatch/components/LogsQueryField.tsx b/public/app/plugins/datasource/cloudwatch/components/LogsQueryField.tsx index 0c703275f24..7badbcd7bc3 100644 --- a/public/app/plugins/datasource/cloudwatch/components/LogsQueryField.tsx +++ b/public/app/plugins/datasource/cloudwatch/components/LogsQueryField.tsx @@ -119,7 +119,15 @@ export class CloudWatchLogsQueryField extends React.PureComponent { if (err.data?.error) { throw err.data.error; + } else if (err.data?.message) { + // In PROD we do not supply .error + throw err.data.message; } throw err;