Modify the way to handle 409 error

Signed-off-by: sshijun <sshijun@vmware.com>
This commit is contained in:
sshijun 2019-11-13 14:21:03 +08:00
parent 8849b0fb9c
commit 1371d53a97
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.errorHandler.info(res);
});
// reset metrics and then get new metrics
this.scanningMetrics = null;
this.getManualMetrics();
}
, error => {

View File

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

View File

@ -138,7 +138,11 @@ export class ResultBarChartComponent implements OnInit, OnDestroy {
}
}, error => {
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);
}
});
}