-
Notifications
You must be signed in to change notification settings - Fork 18
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Packages on differents feed not supported #48
Comments
As you can see here this function checks all sources to get the package version the first successful response is always the answer. |
Yeah, I think that is good but the problem if the try - catch if (jsonResponse && !Array.isArray(jsonResponse.versions) As is throwing the exception event when had the any breaks the response for the throw |
Hello, It seems that I have the same issue
|
may be plugin needs to look at |
Event when the configuration support add different sources, if the packages are on different feeds throw exception because is not found on the first feed that is read on the configurations
async function getPackageVersions(packageName: string, packageSources: PackageSource[], nugetRequestTimeout: number, vscodeHttpConfig: any): Promise {
let result: PackageVersion | undefined | null;
let errors: string[] = [];
try {
result = await Promise.any(packageSources.map(async (src) => {
let url = src.packageVersionsUrl.replace("{{packageName}}", packageName?.toLowerCase());
const requestOption = getRequestOptions(src.authorization, nugetRequestTimeout, vscodeHttpConfig);
return await fetch(url, requestOption)
.then(async response => {
const rawResult = await response.text();
let jsonResponse;
try {
jsonResponse = JSON.parse(rawResult);
if (jsonResponse && !Array.isArray(jsonResponse.versions)
|| (Array.isArray(jsonResponse.versions) && jsonResponse.versions.length == 0)) {
throw "not found";
}
} catch (ex) {
errors.push(
[NuGet Package Manager GUI => ERROR!!!] [Request to url:${url}] [timeout:${nugetRequestTimeout}] [proxy is active:${!!requestOption.agent}] [auth is active:${src.authorization && src.authorization.authType != AuthorizationType[AuthorizationType.none]}] [result:${rawResult}]${EOL}
);throw ex;
}
} catch (e) {
console.log(e);
console.log(errors);
throw
[An error occurred in the loading package versions (package:${packageName})] details logged in VSCode developer tools
;}
return result;
}
Throw not found cause error and packages are not loaded nuget.module.ts line 61
The text was updated successfully, but these errors were encountered: