Skip to content
Snippets Groups Projects
Commit 5bfea134 authored by Rhys Arkins's avatar Rhys Arkins
Browse files

fix(pypi): move lookupUrl inside try/catch

parent 88b60151
No related branches found
No related tags found
No related merge requests found
......@@ -35,9 +35,10 @@ async function getDependency(
hostUrl: string,
compatibility: Record<string, string>
): Promise<ReleaseResult | null> {
const lookupUrl = url.resolve(hostUrl, `${packageName}/json`);
try {
const lookupUrl = url.resolve(hostUrl, `${packageName}/json`);
const dependency: ReleaseResult = { releases: null };
logger.debug({ lookupUrl }, 'Pypi api got lookup');
const rep = await got(url.parse(lookupUrl), {
json: true,
hostType: id,
......@@ -47,6 +48,7 @@ async function getDependency(
logger.debug({ dependency: packageName }, 'pip package not found');
return null;
}
logger.debug({ lookupUrl }, 'Got pypi api result');
if (
!(dep.info && normalizeName(dep.info.name) === normalizeName(packageName))
) {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment