From e9c032f10fe5461afe03c65bb159d2ee0ca96af1 Mon Sep 17 00:00:00 2001 From: Andrej Ocenas Date: Fri, 6 Aug 2021 15:47:27 +0200 Subject: [PATCH] CloudWatch Logs: Fix crash when no region is configured (#37639) --- .../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;