From 677fbab7e14623853c815c8b481fee9cbf7a14d8 Mon Sep 17 00:00:00 2001 From: David Cui <53581635+davidcui1225@users.noreply.github.com> Date: Mon, 1 Nov 2021 15:17:11 -0700 Subject: [PATCH] Catch Notifications Errors on Details Pages (#197) * add catch statements to notifications get_configs to avoid crashing details pages Signed-off by: David Cui * remove console log statment Signed-off by: David Cui --- .../report_definition_details/report_definition_details.tsx | 3 +++ .../public/components/main/report_details/report_details.tsx | 3 +++ 2 files changed, 6 insertions(+) diff --git a/dashboards-reports/public/components/main/report_definition_details/report_definition_details.tsx b/dashboards-reports/public/components/main/report_definition_details/report_definition_details.tsx index 35875e47..3498e197 100644 --- a/dashboards-reports/public/components/main/report_definition_details/report_definition_details.tsx +++ b/dashboards-reports/public/components/main/report_definition_details/report_definition_details.tsx @@ -497,6 +497,9 @@ export function ReportDefinitionDetails(props: { match?: any; setBreadcrumbs?: a setChannels(availableChannels); return availableChannels; }) + .catch((error: any) => { + console.log('error when retrieving notification configs:', error); + }) .then((availableChannels: any) => { httpClient .get(`../api/reporting/reportDefinitions/${reportDefinitionId}`) diff --git a/dashboards-reports/public/components/main/report_details/report_details.tsx b/dashboards-reports/public/components/main/report_details/report_details.tsx index 3fc01585..fe8551b7 100644 --- a/dashboards-reports/public/components/main/report_details/report_details.tsx +++ b/dashboards-reports/public/components/main/report_details/report_details.tsx @@ -295,6 +295,9 @@ export function ReportDetails(props: { match?: any; setBreadcrumbs?: any; httpCl let availableChannels = getAvailableNotificationsChannels(response.config_list); return availableChannels; }) + .catch((error: any) => { + console.log('error when retrieving notification configs:', error); + }) .then((availableChannels: any) => { httpClient .get('../api/reporting/reports/' + reportId)