From e41929e4c8914c17bc8d00d36345d0063134c793 Mon Sep 17 00:00:00 2001 From: Julien Nahum Date: Mon, 15 Jan 2024 16:17:10 +0100 Subject: [PATCH] Debug getDomain in prod --- client/lib/utils.js | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/client/lib/utils.js b/client/lib/utils.js index f5eaf25..4a8b728 100644 --- a/client/lib/utils.js +++ b/client/lib/utils.js @@ -60,7 +60,12 @@ export const getHost = function () { */ export const getDomain = function (url) { if (url.includes('localhost')) return 'localhost' - return (new URL(url)).hostname + try { + return (new URL(url)).hostname + } catch (e) { + console.error('Error extracting domai from: ',url,e) + return null + } } /**