distro: panic less often
Return errors from all distro's New() functions instead of logging and returning nil. Also, return errors instead of panicking from NewRegistry() and NewDefaultRegistry().
This commit is contained in:
parent
d1965d6268
commit
87e9c39532
19 changed files with 128 additions and 62 deletions
|
|
@ -80,7 +80,11 @@ func main() {
|
|||
}
|
||||
|
||||
rpm := rpmmd.NewRPMMD(path.Join(cacheDirectory, "rpmmd"))
|
||||
distros := distro.NewDefaultRegistry([]string{"/etc/osbuild-composer", "/usr/share/osbuild-composer"})
|
||||
|
||||
distros, err := distro.NewDefaultRegistry([]string{"/etc/osbuild-composer", "/usr/share/osbuild-composer"})
|
||||
if err != nil {
|
||||
log.Fatalf("Error loading distros: %v", err)
|
||||
}
|
||||
|
||||
distribution, err := distros.FromHost()
|
||||
if err != nil {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue