From 41a02d1ead62c7196dfa48a72c8a1508f672f976 Mon Sep 17 00:00:00 2001 From: Colin Darie Date: Wed, 20 Mar 2024 12:04:08 +0100 Subject: [PATCH] feat: notify sentry when connection test on new host fail --- .../switch_domain_banner_component.html.haml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/app/components/switch_domain_banner_component/switch_domain_banner_component.html.haml b/app/components/switch_domain_banner_component/switch_domain_banner_component.html.haml index efd5db5cb..9366d75f7 100644 --- a/app/components/switch_domain_banner_component/switch_domain_banner_component.html.haml +++ b/app/components/switch_domain_banner_component/switch_domain_banner_component.html.haml @@ -5,7 +5,9 @@ fetch(hintUrl, { mode: 'cors' }).then(() => { window.location = '#{new_host_url}'; }).catch((e) => { - // TODO: notify us in order to monitor connectivity issues volume + const error = new Error("Connection test on new host failed: " + e); + const event = new CustomEvent("sentry:capture-exception", { detail: error }); + setTimeout(() => dispatchEvent(event), 100); // listener is not immediately enabled })