feat: notify sentry when connection test on new host fail

This commit is contained in:
Colin Darie 2024-03-20 12:04:08 +01:00
parent 2f4444bd5e
commit 41a02d1ead
No known key found for this signature in database
GPG key ID: 8C76CADD40253590

View file

@ -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
})