From 80955dfa616e1ea5c4bcde995f2923fb6e771127 Mon Sep 17 00:00:00 2001 From: Leo Kettmeir Date: Mon, 19 Dec 2022 20:58:02 +0100 Subject: fix: display URL in invalid URL error (#17128) --- ext/url/00_url.js | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'ext') diff --git a/ext/url/00_url.js b/ext/url/00_url.js index 5479cb59c..ebb7b6277 100644 --- a/ext/url/00_url.js +++ b/ext/url/00_url.js @@ -64,16 +64,19 @@ componentsBuf.buffer, ); } - return getSerialization(status, href); + return getSerialization(status, href, maybeBase); } - function getSerialization(status, href) { + function getSerialization(status, href, maybeBase) { if (status === 0) { return href; } else if (status === 1) { return core.ops.op_url_get_serialization(); } else { - throw new TypeError("Invalid URL"); + throw new TypeError( + `Invalid URL: '${href}'` + + (maybeBase ? ` with base '${maybeBase}'` : ""), + ); } } -- cgit v1.2.3