Continue if no matches
This commit is contained in:
+5
-11
@@ -51,21 +51,15 @@ export async function processGoGraph (
|
|||||||
* package */
|
* package */
|
||||||
const matches = cache.packagesMatching(matcher)
|
const matches = cache.packagesMatching(matcher)
|
||||||
|
|
||||||
console.log(
|
if (matches.length === 0) return
|
||||||
'matcher:',
|
|
||||||
matcher,
|
|
||||||
'parentPkg:',
|
|
||||||
parentPkg,
|
|
||||||
'childPkg:',
|
|
||||||
childPkg
|
|
||||||
)
|
|
||||||
if (matches.length !== 1) {
|
if (matches.length !== 1) {
|
||||||
throw new Error(
|
throw new Error(
|
||||||
'assertion failed: expected one package in cache with namespace+name. ' +
|
'assertion failed: expected no more than one package in cache with namespace+name. ' +
|
||||||
'Found: ' +
|
'Found: ' +
|
||||||
JSON.stringify(matches) +
|
JSON.stringify(matches) +
|
||||||
'\n' +
|
'for ' +
|
||||||
`matcher: ${matcher} parentPkg: ${parentPkg} childPkg: ${childPkg}`
|
JSON.stringify(matcher)
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
// create the dependency relationship
|
// create the dependency relationship
|
||||||
|
|||||||
Reference in New Issue
Block a user