diff options
-rw-r--r-- | config/style.go | 6 | ||||
-rw-r--r-- | config/ui.go | 6 | ||||
-rw-r--r-- | main.go | 2 |
3 files changed, 8 insertions, 6 deletions
diff --git a/config/style.go b/config/style.go index 1b428f45..95e60616 100644 --- a/config/style.go +++ b/config/style.go @@ -468,7 +468,7 @@ func (ss *StyleSet) ParseStyleSet(file *ini.File) error { ss.user[styleName] = s } if err := s.Set(attr, val); err != nil { - return err + return fmt.Errorf("[user].%s=%s: %w", key, val, err) } } @@ -500,12 +500,12 @@ func (ss *StyleSet) parseKey(key *ini.Key, selected bool) error { if !selected { err = ss.objects[so].update(header, pattern, attr, key.Value()) if err != nil { - return err + return fmt.Errorf("%s=%s: %w", key.Name(), key.Value(), err) } } err = ss.selected[so].update(header, pattern, attr, key.Value()) if err != nil { - return err + return fmt.Errorf("%s=%s: %w", key.Name(), key.Value(), err) } num++ } diff --git a/config/ui.go b/config/ui.go index e7e96f9f..8b10c8a8 100644 --- a/config/ui.go +++ b/config/ui.go @@ -246,8 +246,10 @@ func (ui *UIConfig) loadStyleSet(styleSetDirs []string) error { ui.style = NewStyleSet() err := ui.style.LoadStyleSet(ui.StyleSetName, styleSetDirs) if err != nil { - return fmt.Errorf("Unable to load %q styleset: %w", - ui.StyleSetName, err) + if ui.style.path == "" { + ui.style.path = ui.StyleSetName + } + return fmt.Errorf("%s: %w", ui.style.path, err) } return nil @@ -173,7 +173,7 @@ func main() { nil, opts.Accounts, opts.ConfAerc, opts.ConfBinds, opts.ConfAccounts, ) if err != nil { - die("failed to load config: %s", err) + die("%s", err) } log.Infof("Starting up version %s", log.BuildInfo) |