chore: fix logical order
Some checks failed
Release / call-build-workflow (push) Has been cancelled
Release / Publish Docker :release (push) Has been cancelled
Release / Github & APT (push) Has been cancelled
Release / Demo (push) Has been cancelled
Release / Hassio Addon (push) Has been cancelled

This commit is contained in:
andig 2024-02-19 12:25:26 +01:00
parent 422433f5b4
commit 88b4ac8ac7

View file

@ -25,8 +25,8 @@ func addInstance(subject string, identity *Identity) {
// apiError converts HTTP 408 error to ErrTimeout
func apiError(err error) error {
if err != nil && (errors.Is(err, inet.ErrVehicleNotAwake) ||
strings.HasSuffix(err.Error(), "408 Request Timeout") || strings.HasSuffix(err.Error(), "408 (Request Timeout)")) ||
strings.HasSuffix(err.Error(), "vehicle is offline or asleep") {
strings.HasSuffix(err.Error(), "408 Request Timeout") || strings.HasSuffix(err.Error(), "408 (Request Timeout)") ||
strings.HasSuffix(err.Error(), "vehicle is offline or asleep")) {
err = api.ErrAsleep
}
return err