mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-01-27 09:35:37 -05:00
Fix incorrect .NET error (#16694)
* Fix .NET Install state for error conditions * Address comment- remove redundant constructor
This commit is contained in:
@@ -148,15 +148,21 @@ export class NetCoreTool {
|
||||
child.on('exit', () => {
|
||||
this.netCoreSdkInstalledVersion = Buffer.concat(stdoutBuffers).toString('utf8').trim();
|
||||
|
||||
if (semver.gte(this.netCoreSdkInstalledVersion, minSupportedNetCoreVersion)) { // Net core version greater than or equal to minSupportedNetCoreVersion are supported for Build
|
||||
isSupported = true;
|
||||
} else {
|
||||
isSupported = false;
|
||||
try {
|
||||
if (semver.gte(this.netCoreSdkInstalledVersion, minSupportedNetCoreVersion)) { // Net core version greater than or equal to minSupportedNetCoreVersion are supported for Build
|
||||
isSupported = true;
|
||||
} else {
|
||||
isSupported = false;
|
||||
}
|
||||
resolve({ stdout: this.netCoreSdkInstalledVersion });
|
||||
} catch (err) {
|
||||
console.log(err);
|
||||
reject(err);
|
||||
}
|
||||
resolve({ stdout: this.netCoreSdkInstalledVersion });
|
||||
});
|
||||
child.on('error', (err) => {
|
||||
console.log(err);
|
||||
this.netCoreInstallState = netCoreInstallState.netCoreNotPresent;
|
||||
reject(err);
|
||||
});
|
||||
});
|
||||
@@ -170,7 +176,7 @@ export class NetCoreTool {
|
||||
return isSupported;
|
||||
} catch (err) {
|
||||
console.log(err);
|
||||
this.netCoreInstallState = netCoreInstallState.netCoreVersionNotSupported;
|
||||
this.netCoreInstallState = netCoreInstallState.netCoreNotPresent;
|
||||
return undefined;
|
||||
}
|
||||
}
|
||||
@@ -182,9 +188,9 @@ export class NetCoreTool {
|
||||
|
||||
if (!(await this.findOrInstallNetCore())) {
|
||||
if (this.netCoreInstallState === netCoreInstallState.netCoreNotPresent) {
|
||||
throw new Error(NetCoreInstallationConfirmation);
|
||||
throw new DotNetError(NetCoreInstallationConfirmation);
|
||||
} else {
|
||||
throw new Error(NetCoreSupportedVersionInstallationConfirmation(this.netCoreSdkInstalledVersion!));
|
||||
throw new DotNetError(NetCoreSupportedVersionInstallationConfirmation(this.netCoreSdkInstalledVersion!));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -246,3 +252,7 @@ export class NetCoreTool {
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
export class DotNetError extends Error {
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user