Skip to content

Commit

Permalink
chore: fix logical order
Browse files Browse the repository at this point in the history
  • Loading branch information
andig committed Feb 19, 2024
1 parent 422433f commit 88b4ac8
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions vehicle/tesla/helper.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 88b4ac8

Please sign in to comment.