bogosj / tesla

Provides a wrapper around the API to easily query and command a Telsa car.
Other
23 stars 18 forks source link

Error messages swallowed #86

Open andig opened 1 year ago

andig commented 1 year ago

Whenever we receive a non-200 response, the response JSON is ignored and any contained error swallowed:

HTTP/2.0 408 Request Timeout
Content-Length: 106
Cache-Control: no-cache, no-store, private, s-max-age=0
Content-Type: application/json; charset=utf-8
Date: Fri, 30 Dec 2022 15:46:15 GMT
Server: envoy
Strict-Transport-Security: max-age=31536000; includeSubDomains
Vary: Accept
X-Content-Type-Options: nosniff
X-Envoy-Upstream-Cluster: owner-api
X-Envoy-Upstream-Service-Time: 35
X-Frame-Options: DENY
X-Request-Id: 607ca386-1396-48f4-8846-26ae6d5cf866
X-Txid: 443ce41d67afee316399a80eefb2243d
X-Xss-Protection: 1; mode=block

{"response":null,"error":"vehicle unavailable: {:error=>\"vehicle unavailable:\"}","error_description":""}

Will only ever return the HTTP 408 although the code seems to suggest that we're actually decoding the error (which itself is json encoded as string...).