diff options
author | Leo Kettmeir <crowlkats@toaxl.com> | 2022-12-19 20:58:02 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-12-19 20:58:02 +0100 |
commit | 80955dfa616e1ea5c4bcde995f2923fb6e771127 (patch) | |
tree | 4bdc9690d6092c068ee48644450fde09ae4775d3 /ext/url/00_url.js | |
parent | 2ff27a1f9327bf913d7b9d6aadc703a30a297e11 (diff) |
fix: display URL in invalid URL error (#17128)
Diffstat (limited to 'ext/url/00_url.js')
-rw-r--r-- | ext/url/00_url.js | 9 |
1 files changed, 6 insertions, 3 deletions
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}'` : ""), + ); } } |