Standardize error messages by removing config prefix

This commit is contained in:
andig 2020-07-29 14:10:49 +02:00
parent 3de1f3d072
commit 1e03a51eae
15 changed files with 23 additions and 31 deletions

View file

@ -70,7 +70,7 @@ func NewSMA(uri, serial, power, energy string) (api.Meter, error) {
} else if serial != "" {
sma.Instance.Subscribe(serial, sm.recv)
} else {
return nil, errors.New("config: missing uri or serial")
return nil, errors.New("missing uri or serial")
}
go sm.receive()

View file

@ -46,12 +46,12 @@ func NewTeslaFromConfig(other map[string]interface{}) (api.Meter, error) {
}
if cc.Usage == "" {
return nil, errors.New("config: missing usage")
return nil, errors.New("missing usage setting")
}
url, err := url.ParseRequestURI(cc.URI)
if err != nil {
return nil, fmt.Errorf("config: invalid uri %s", cc.URI)
return nil, fmt.Errorf("invalid uri %s", cc.URI)
}
if url.Path == "" {