Merge pull request #9857 from AllForNothing/error-handle

Modify the way to handle 409 error
This commit is contained in:
Will Sun 2019-11-13 19:20:41 +08:00 committed by GitHub
commit b4039eb256
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 9 additions and 6 deletions

View File

@ -228,6 +228,8 @@ export class VulnerabilityConfigComponent implements OnInit, OnDestroy {
this.translate.get("CONFIG.SCANNING.TRIGGER_SCAN_ALL_SUCCESS").subscribe((res: string) => { this.translate.get("CONFIG.SCANNING.TRIGGER_SCAN_ALL_SUCCESS").subscribe((res: string) => {
this.errorHandler.info(res); this.errorHandler.info(res);
}); });
// reset metrics and then get new metrics
this.scanningMetrics = null;
this.getManualMetrics(); this.getManualMetrics();
} }
, error => { , error => {

View File

@ -745,12 +745,9 @@ export class TagComponent implements OnInit, AfterViewInit {
} }
// Trigger scan // Trigger scan
scanNow(): void { scanNow(): void {
if (this.selectedRow && this.selectedRow.length) { if (this.selectedRow && this.selectedRow.length === 1) {
this.selectedRow.forEach((data: any) => {
let tagId = data.name;
this.onSendingScanCommand = true; this.onSendingScanCommand = true;
this.channel.publishScanEvent(this.repoName + "/" + tagId); this.channel.publishScanEvent(this.repoName + "/" + this.selectedRow[0].name);
});
} }
} }
submitFinish(e: boolean) { submitFinish(e: boolean) {

View File

@ -138,7 +138,11 @@ export class ResultBarChartComponent implements OnInit, OnDestroy {
} }
}, error => { }, error => {
this.onSubmitting = false; this.onSubmitting = false;
this.errorHandler.error(error); if (error && error.error && error.error.code === 409) {
console.log(error.error.message);
} else {
this.errorHandler.error(error);
}
}); });
} }