Skip to content

Commit

Permalink
enh: Give info when unable to load list of repos
Browse files Browse the repository at this point in the history
  • Loading branch information
smutel authored and randombenj committed Apr 25, 2022
1 parent 152538c commit 4c04e77
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
1 change: 1 addition & 0 deletions AUTHORS
Original file line number Diff line number Diff line change
Expand Up @@ -46,3 +46,4 @@ List of contributors, in chronological order:
* Benj Fassbind (https://github.com/randombenj)
* Markus Muellner (https://github.com/mmianl)
* Chuan Liu (https://github.com/chuan)
* Samuel Mutel (https://github.com/smutel)
5 changes: 5 additions & 0 deletions cmd/publish_list.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ package cmd
import (
"encoding/json"
"fmt"
"os"
"sort"

"github.com/aptly-dev/aptly/deb"
Expand Down Expand Up @@ -35,6 +36,8 @@ func aptlyPublishListTxt(cmd *commander.Command, args []string) error {
err = collectionFactory.PublishedRepoCollection().ForEach(func(repo *deb.PublishedRepo) error {
e := collectionFactory.PublishedRepoCollection().LoadComplete(repo, collectionFactory)
if e != nil {
fmt.Fprintf(os.Stderr, "Error found on one publish (prefix:%s / distribution:%s / component:%s\n)",
repo.StoragePrefix(), repo.Distribution, repo.Components())
return e
}

Expand Down Expand Up @@ -82,6 +85,8 @@ func aptlyPublishListJSON(cmd *commander.Command, args []string) error {
err = context.NewCollectionFactory().PublishedRepoCollection().ForEach(func(repo *deb.PublishedRepo) error {
e := context.NewCollectionFactory().PublishedRepoCollection().LoadComplete(repo, context.NewCollectionFactory())
if e != nil {
fmt.Fprintf(os.Stderr, "Error found on one publish (prefix:%s / distribution:%s / component:%s\n)",
repo.StoragePrefix(), repo.Distribution, repo.Components())
return e
}

Expand Down

0 comments on commit 4c04e77

Please sign in to comment.