panic for uncaught errors

Signed-off-by: Josh Dolitsky <jdolitsky@gmail.com>
pull/5597/head
Josh Dolitsky 7 years ago
parent 97c623cb50
commit a454e0c0bd

@ -70,10 +70,16 @@ func newRootCmd(actionConfig *action.Configuration, out io.Writer, args []string
// Add the registry client based on settings // Add the registry client based on settings
// TODO: Move this elsewhere (first, settings.Init() must move) // TODO: Move this elsewhere (first, settings.Init() must move)
// TODO: handle errors // TODO: handle errors, dont panic
credentialsFile := filepath.Join(settings.Home.Registry(), registry.CredentialsFileBasename) credentialsFile := filepath.Join(settings.Home.Registry(), registry.CredentialsFileBasename)
client, _ := auth.NewClient(credentialsFile) client, err := auth.NewClient(credentialsFile)
resolver, _ := client.Resolver(context.Background()) if err != nil {
panic(err)
}
resolver, err := client.Resolver(context.Background())
if err != nil {
panic(err)
}
actionConfig.RegistryClient = registry.NewClient(&registry.ClientOptions{ actionConfig.RegistryClient = registry.NewClient(&registry.ClientOptions{
Out: out, Out: out,
Authorizer: registry.Authorizer{ Authorizer: registry.Authorizer{

Loading…
Cancel
Save