Improve error messages for bootstrap info
Change-Id: I727363b794a11a97af08d05e5e7b227a3fa51016
This commit is contained in:
parent
0501a3b919
commit
090d80ed70
@ -697,6 +697,12 @@ func (c *Config) CurrentContextBootstrapInfo() (*Bootstrap, error) {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
if currentCluster.Bootstrap == "" {
|
||||
return nil, ErrMissingConfig{
|
||||
What: fmt.Sprintf("No bootstrap-info defined for context %q", c.CurrentContext),
|
||||
}
|
||||
}
|
||||
|
||||
bootstrap, exists := c.ModulesConfig.BootstrapInfo[currentCluster.Bootstrap]
|
||||
if !exists {
|
||||
return nil, ErrBootstrapInfoNotFound{Name: currentCluster.Bootstrap}
|
||||
|
@ -57,7 +57,7 @@ type ErrBootstrapInfoNotFound struct {
|
||||
}
|
||||
|
||||
func (e ErrBootstrapInfoNotFound) Error() string {
|
||||
return fmt.Sprintf("Bootstrap info %s not found", e.Name)
|
||||
return fmt.Sprintf("Bootstrap info %q not found", e.Name)
|
||||
}
|
||||
|
||||
// ErrWrongConfig returned in case of incorrect configuration
|
||||
|
Loading…
x
Reference in New Issue
Block a user