From ad388e5a6ac19cd73cec2125d5270b2f4832e678 Mon Sep 17 00:00:00 2001 From: Mateusz Pietryga Date: Tue, 27 Aug 2024 08:49:04 +0200 Subject: [PATCH] fix: Failed to construct 'URL': Invalid URL everytime the URL is modified (#2897) * fix: Failed to construct 'URL': Invalid URL everytime the URL is modified A non-parsable URL should be an acceptable state while the text is being typed. * chore: path params are returned as empty --------- Co-authored-by: Anoop M D --- packages/bruno-app/src/utils/url/index.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/packages/bruno-app/src/utils/url/index.js b/packages/bruno-app/src/utils/url/index.js index e00cee484..f6feff0a0 100644 --- a/packages/bruno-app/src/utils/url/index.js +++ b/packages/bruno-app/src/utils/url/index.js @@ -44,7 +44,8 @@ export const parsePathParams = (url) => { try { uri = new URL(uri); } catch (e) { - throw e; + // URL is non-parsable, is it incomplete? Ignore. + return []; } let paths = uri.pathname.split('/');