Standardize error messages by removing config prefix
This commit is contained in:
parent
3de1f3d072
commit
1e03a51eae
15 changed files with 23 additions and 31 deletions
|
|
@ -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()
|
||||
|
|
|
|||
|
|
@ -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 == "" {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue