raise error with invalid 'on_success', 'on_failure' in profile (#2303)
This commit is contained in:
parent
956703c31a
commit
e404e0b608
2 changed files with 6 additions and 6 deletions
pkg
|
@ -48,10 +48,10 @@ func NewProfile(profilesCfg []*csconfig.ProfileCfg) ([]*Runtime, error) {
|
|||
runtime.DebugFilters = make([]*exprhelpers.ExprDebugger, len(profile.Filters))
|
||||
runtime.Cfg = profile
|
||||
if runtime.Cfg.OnSuccess != "" && runtime.Cfg.OnSuccess != "continue" && runtime.Cfg.OnSuccess != "break" {
|
||||
return []*Runtime{}, errors.Wrapf(err, "invalid 'on_success' for '%s' : %s", profile.Name, runtime.Cfg.OnSuccess)
|
||||
return []*Runtime{}, fmt.Errorf("invalid 'on_success' for '%s': %s", profile.Name, runtime.Cfg.OnSuccess)
|
||||
}
|
||||
if runtime.Cfg.OnFailure != "" && runtime.Cfg.OnFailure != "continue" && runtime.Cfg.OnFailure != "break" && runtime.Cfg.OnFailure != "apply" {
|
||||
return []*Runtime{}, errors.Wrapf(err, "invalid 'on_failure' for '%s' : %s", profile.Name, runtime.Cfg.OnFailure)
|
||||
return []*Runtime{}, fmt.Errorf("invalid 'on_failure' for '%s' : %s", profile.Name, runtime.Cfg.OnFailure)
|
||||
}
|
||||
for fIdx, filter := range profile.Filters {
|
||||
|
||||
|
|
|
@ -215,7 +215,7 @@ func (m *Metabase) Login(username string, password string) error {
|
|||
}
|
||||
|
||||
if errormsg != nil {
|
||||
return errors.Wrap(err, "http login")
|
||||
return fmt.Errorf("http login: %s", errormsg)
|
||||
}
|
||||
resp, ok := successmsg.(map[string]interface{})
|
||||
if !ok {
|
||||
|
@ -238,7 +238,7 @@ func (m *Metabase) Scan() error {
|
|||
return err
|
||||
}
|
||||
if errormsg != nil {
|
||||
return errors.Wrap(err, "http scan")
|
||||
return fmt.Errorf("http scan: %s", errormsg)
|
||||
}
|
||||
|
||||
return nil
|
||||
|
@ -255,7 +255,7 @@ func (m *Metabase) ResetPassword(current string, newPassword string) error {
|
|||
return errors.Wrap(err, "reset username")
|
||||
}
|
||||
if errormsg != nil {
|
||||
return errors.Wrap(err, "http reset password")
|
||||
return fmt.Errorf("http reset password: %s", errormsg)
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
@ -279,7 +279,7 @@ func (m *Metabase) ResetUsername(username string) error {
|
|||
}
|
||||
|
||||
if errormsg != nil {
|
||||
return errors.Wrap(err, "http reset username")
|
||||
return fmt.Errorf("http reset username: %s", errormsg)
|
||||
}
|
||||
|
||||
return nil
|
||||
|
|
Loading…
Add table
Reference in a new issue