OpenEVSE: fix http 404
This commit is contained in:
parent
1e1acd5627
commit
1d5cdca813
1 changed files with 4 additions and 2 deletions
|
|
@ -93,11 +93,13 @@ func (c *OpenEVSE) setOverride() error {
|
|||
uri := fmt.Sprintf("%s/override", c.uri)
|
||||
|
||||
if err := c.GetJSON(uri, &data); err != nil {
|
||||
if err.Error() != "unexpected status: 404 (Not Found)" {
|
||||
return err
|
||||
if se, ok := errors.AsType[*request.StatusError](err); ok && se.HasStatus(404) {
|
||||
goto IGNORE
|
||||
}
|
||||
return err
|
||||
}
|
||||
|
||||
IGNORE:
|
||||
state := openevse.Disabled
|
||||
if c.enabled {
|
||||
state = openevse.Enabled
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue