mirror of
https://github.com/goharbor/harbor.git
synced 2024-12-24 09:38:09 +01:00
Merge pull request #9857 from AllForNothing/error-handle
Modify the way to handle 409 error
This commit is contained in:
commit
b4039eb256
@ -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 => {
|
||||||
|
@ -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) {
|
||||||
|
@ -138,7 +138,11 @@ export class ResultBarChartComponent implements OnInit, OnDestroy {
|
|||||||
}
|
}
|
||||||
}, error => {
|
}, error => {
|
||||||
this.onSubmitting = false;
|
this.onSubmitting = false;
|
||||||
|
if (error && error.error && error.error.code === 409) {
|
||||||
|
console.log(error.error.message);
|
||||||
|
} else {
|
||||||
this.errorHandler.error(error);
|
this.errorHandler.error(error);
|
||||||
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user