Skip to content

Commit c4510ea

Browse files
committed
Add debuggable output for url version issues
1 parent 09713c5 commit c4510ea

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

lib/hooks/usePantry.getVersions.ts

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -266,6 +266,20 @@ async function handleURLVersions(versions: PlainObject): Promise<SemVer[]> {
266266
// the text of the link. We don't want to double count.
267267
if (v && !rv.find((vx) => vx.raw === v.raw)) rv.push(v);
268268
}
269+
270+
if (rv.length == 0) {
271+
const m: string[] = []
272+
for (const match of body.matchAll(new RegExp(matcher.slice(1, -1), "g"))) {
273+
m.push(match.join(","))
274+
}
275+
console.warn(`parsing ${url} produced no versions`)
276+
if (m.length == 0) {
277+
console.warn("no matches for regex")
278+
} else {
279+
console.warn("matches:", m.join(" "))
280+
}
281+
}
282+
269283
return rv;
270284
}
271285

0 commit comments

Comments
 (0)