publish: check if storage exists

This commit is contained in:
André Roth
2026-06-18 13:36:17 +02:00
parent 29e643cdf6
commit dd85493b1a
14 changed files with 94 additions and 70 deletions
+3 -3
View File
@@ -62,12 +62,12 @@ type FakeStorageProvider struct {
storages map[string]aptly.PublishedStorage
}
func (p *FakeStorageProvider) GetPublishedStorage(name string) aptly.PublishedStorage {
func (p *FakeStorageProvider) GetPublishedStorage(name string) (aptly.PublishedStorage, error) {
storage, ok := p.storages[name]
if !ok {
panic(fmt.Sprintf("unknown storage: %#v", name))
return nil, fmt.Errorf("unknown storage: %#v", name)
}
return storage
return storage, nil
}
type PublishedRepoSuite struct {