Skip to content

Commit 4093bba

Browse files
committed
Add the url in the error object, fixes #14
1 parent 468f965 commit 4093bba

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

lib/index.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,9 @@ const parseUrl = (url, normalize = false) => {
4040
const GIT_RE = /((git@|http(s)?:\/\/)([\w\.@]+)(\/|:))(([\~,\w,\-,\_,\/]+)(.git){0,1}((\/){0,1}))/
4141

4242
if (typeof url !== "string" || !url.trim()) {
43-
throw new Error("Invalid url.")
43+
const err = new Error("Invalid url.")
44+
err.subject_url = url
45+
throw err
4446
}
4547

4648
if (normalize) {

0 commit comments

Comments
 (0)