VW: fix login (#25540)

This commit is contained in:
Oliver Rahner 2025-11-25 17:44:48 +01:00 • committed by GitHub
parent d42122f7e8
commit e6fe76f293
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
4 changed files with 179 additions and 52 deletions

View file

@ -2,6 +2,7 @@ package api
import (
"errors"
"net/url"
"github.com/cenkalti/backoff/v4"
)
@ -43,6 +44,25 @@ func (err *ErrLoginRequired) Error() string {
return "login required"
}
// ErrUrl indicates that the error contains an extractable URL
type ErrUrl struct {
err string
url *url.URL
}
// UrlError creates an error message containing an url
func UrlError(err string, url *url.URL) *ErrUrl {
return &ErrUrl{err, url}
}
func (err *ErrUrl) Error() string {
return err.err
}
func (err *ErrUrl) URL() *url.URL {
return err.url
}
// ErrAsleep indicates that vehicle is asleep. Caller may chose to wake up the vehicle and retry.
var ErrAsleep error = errAsleep{}