Fixed assessment error handling (#16610)

Displaying striped files in sts
This commit is contained in:
Aasim Khan
2021-08-06 23:01:56 -07:00
committed by GitHub
parent 0f229b3444
commit f1b9931116
3 changed files with 35 additions and 19 deletions

View File

@@ -526,17 +526,18 @@ export class MigrationCutoverDialog {
if (this._shouldDisplayBackupFileTable()) { if (this._shouldDisplayBackupFileTable()) {
tableData.push( tableData.push(
{ ...activeBackupSet.listOfBackupFiles.map(f => {
fileName: activeBackupSet.listOfBackupFiles[0].fileName, return {
fileName: f.fileName,
type: activeBackupSet.backupType, type: activeBackupSet.backupType,
status: activeBackupSet.listOfBackupFiles[0].status, status: f.status,
dataUploaded: `${convertByteSizeToReadableUnit(activeBackupSet.listOfBackupFiles[0].dataWritten)}/ ${convertByteSizeToReadableUnit(activeBackupSet.listOfBackupFiles[0].totalSize)}`, dataUploaded: `${convertByteSizeToReadableUnit(f.dataWritten)}/ ${convertByteSizeToReadableUnit(f.totalSize)}`,
copyThroughput: (activeBackupSet.listOfBackupFiles[0].copyThroughput) ? (activeBackupSet.listOfBackupFiles[0].copyThroughput / 1024).toFixed(2) : '-', copyThroughput: (f.copyThroughput) ? (f.copyThroughput / 1024).toFixed(2) : '-',
backupStartTime: activeBackupSet.backupStartDate, backupStartTime: activeBackupSet.backupStartDate,
firstLSN: activeBackupSet.firstLSN, firstLSN: activeBackupSet.firstLSN,
lastLSN: activeBackupSet.lastLSN lastLSN: activeBackupSet.lastLSN
};
} })
); );
} }

View File

@@ -190,15 +190,15 @@ export class MigrationStateModel implements Model, vscode.Disposable {
try { try {
this._assessmentApiResponse = (await this.migrationService.getAssessments(ownerUri, this._databaseAssessment))!; this._assessmentApiResponse = (await this.migrationService.getAssessments(ownerUri, this._databaseAssessment))!;
this._assessmentResults = { this._assessmentResults = {
issues: this._assessmentApiResponse.assessmentResult.items, issues: this._assessmentApiResponse?.assessmentResult?.items ?? [],
databaseAssessments: this._assessmentApiResponse.assessmentResult.databases.map(d => { databaseAssessments: this._assessmentApiResponse?.assessmentResult?.databases?.map(d => {
return { return {
name: d.name, name: d.name,
issues: d.items, issues: d.items,
errors: d.errors errors: d.errors
}; };
}), }) ?? [],
errors: this._assessmentApiResponse.errors errors: this._assessmentApiResponse?.errors ?? []
}; };
} catch (error) { } catch (error) {
this._assessmentResults = { this._assessmentResults = {

View File

@@ -447,16 +447,31 @@ export class SKURecommendationPage extends MigrationWizardPage {
await this.migrationStateModel.getDatabaseAssessments(); await this.migrationStateModel.getDatabaseAssessments();
this._detailsComponent.value = constants.SKU_RECOMMENDATION_ALL_SUCCESSFUL(this.migrationStateModel._assessmentResults.databaseAssessments.length); this._detailsComponent.value = constants.SKU_RECOMMENDATION_ALL_SUCCESSFUL(this.migrationStateModel._assessmentResults.databaseAssessments.length);
const error = this.migrationStateModel._assessmentResults.assessmentError; const errors: string[] = [];
if (error) { const assessmentError = this.migrationStateModel._assessmentResults.assessmentError;
if (assessmentError) {
errors.push(`message: ${assessmentError.message}
stack: ${assessmentError.stack}
`);
}
if (this.migrationStateModel?._assessmentResults?.errors?.length! > 0) {
errors.push(...this.migrationStateModel._assessmentResults.errors?.map(e => `message: ${e.message}
errorSummary: ${e.errorSummary}
possibleCauses: ${e.possibleCauses}
guidance: ${e.guidance}
errorId: ${e.errorId}
`)!);
}
if (errors.length > 0) {
this.wizard.message = { this.wizard.message = {
text: constants.SKU_RECOMMENDATION_ASSESSMENT_ERROR(serverName), text: constants.SKU_RECOMMENDATION_ASSESSMENT_ERROR(serverName),
description: error.message + EOL + error.stack, description: errors.join(EOL),
level: azdata.window.MessageLevel.Error level: azdata.window.MessageLevel.Error
}; };
} }
this.migrationStateModel._runAssessments = !!error; this.migrationStateModel._runAssessments = errors.length > 0;
} catch (e) { } catch (e) {
console.log(e); console.log(e);
} }