mirror of
https://github.com/aptly-dev/aptly.git
synced 2026-01-12 03:21:33 +00:00
api: repo copy handle package not found
and add tests for error proper handling.
This commit is contained in:
@@ -524,6 +524,10 @@ func apiReposCopyPackage(c *gin.Context) {
|
||||
return &task.ProcessReturnValue{Code: http.StatusInternalServerError, Value: nil}, fmt.Errorf("filter error: %s", err)
|
||||
}
|
||||
|
||||
if toProcess.Len() == 0 {
|
||||
return &task.ProcessReturnValue{Code: http.StatusUnprocessableEntity, Value: nil}, fmt.Errorf("no package found for filter: '%s'", fileName)
|
||||
}
|
||||
|
||||
err = toProcess.ForEach(func(p *deb.Package) error {
|
||||
err = dstList.Add(p)
|
||||
if err != nil {
|
||||
|
||||
Reference in New Issue
Block a user