Fallback logic

This commit is contained in:
HarithaVattikuti
2024-12-25 18:47:48 -06:00
parent 0126ca49f0
commit 2984211dcd
2 changed files with 24 additions and 4 deletions

View File

@ -101,9 +101,18 @@ export class DotnetVersionResolver {
allowRetries: true,
maxRetries: 3
});
const response = await httpClient.getJson<any>(
DotnetVersionResolver.DotNetCoreIndexUrl
);
let response;
try {
response = await httpClient.getJson<any>(
DotnetVersionResolver.DotNetCoreIndexUrl
);
} catch (error) {
response = await httpClient.getJson<any>(
DotnetVersionResolver.DotnetCoreIndexFallbackUrl
);
}
const result = response.result || {};
const releasesInfo: any[] = result['releases-index'];
@ -123,6 +132,10 @@ export class DotnetVersionResolver {
static DotNetCoreIndexUrl =
'https://builds.dotnet.microsoft.com/dotnet/release-metadata/releases-index.json';
static DotnetCoreIndexFallbackUrl =
'https://dotnetcli.azureedge.net/dotnet/release-metadata/releases-index.json';
}
export class DotnetCoreInstaller {