Skip to content

Commit

Permalink
More verbose npm error
Browse files Browse the repository at this point in the history
  • Loading branch information
jakebailey committed Dec 8, 2023
1 parent 22721c9 commit ab655b5
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
5 changes: 3 additions & 2 deletions dist/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -7134,10 +7134,11 @@ async function downloadPyright(info3) {
async function getPyrightInfo() {
const version3 = await getPyrightVersion();
const client = new httpClient.HttpClient();
const resp = await client.get(`https://registry.npmjs.org/pyright/${version3}`);
const url = `https://registry.npmjs.org/pyright/${version3}`;
const resp = await client.get(url);
const body = await resp.readBody();
if (resp.message.statusCode !== httpClient.HttpCodes.OK) {
throw new Error(body);
throw new Error(`Failed to download metadata for pyright ${version3} from ${url} -- ${body}`);
}
return parseNpmRegistryResponse(JSON.parse(body));
}
Expand Down
5 changes: 3 additions & 2 deletions src/helpers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -206,10 +206,11 @@ async function downloadPyright(info: NpmRegistryResponse): Promise<string> {
async function getPyrightInfo(): Promise<NpmRegistryResponse> {
const version = await getPyrightVersion();
const client = new httpClient.HttpClient();
const resp = await client.get(`https://registry.npmjs.org/pyright/${version}`);
const url = `https://registry.npmjs.org/pyright/${version}`;
const resp = await client.get(url);
const body = await resp.readBody();
if (resp.message.statusCode !== httpClient.HttpCodes.OK) {
throw new Error(body);
throw new Error(`Failed to download metadata for pyright ${version} from ${url} -- ${body}`);
}
return parseNpmRegistryResponse(JSON.parse(body));
}
Expand Down

0 comments on commit ab655b5

Please sign in to comment.