Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adjust error handling for Gigya JSONDecodeError #789

Merged
merged 2 commits into from
Feb 9, 2023
Merged

Conversation

epenet
Copy link
Collaborator

@epenet epenet commented Feb 8, 2023

Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/config_entries.py", line 382, in async_setup
    result = await component.async_setup_entry(hass, self)
  File "/usr/src/homeassistant/homeassistant/components/renault/__init__.py", line 28, in async_setup_entry
    await renault_hub.async_initialise(config_entry)
  File "/usr/src/homeassistant/homeassistant/components/renault/renault_hub.py", line 59, in async_initialise
    vehicles = await self._account.get_vehicles()
  File "/usr/local/lib/python3.10/site-packages/renault_api/renault_account.py", line 62, in get_vehicles
    return await self.session.get_account_vehicles(
  File "/usr/local/lib/python3.10/site-packages/renault_api/renault_session.py", line 192, in get_account_vehicles
    gigya_jwt=await self._get_jwt(),
  File "/usr/local/lib/python3.10/site-packages/renault_api/renault_session.py", line 142, in _get_jwt
    response = await gigya.get_jwt(
  File "/usr/local/lib/python3.10/site-packages/renault_api/gigya/__init__.py", line 102, in get_jwt
    await request(
  File "/usr/local/lib/python3.10/site-packages/renault_api/gigya/__init__.py", line 38, in request
    gigya_response: models.GigyaResponse = schema.loads(response_text)
  File "/usr/local/lib/python3.10/site-packages/marshmallow/schema.py", line 755, in loads
    data = self.opts.render_module.loads(json_data, **kwargs)
  File "/usr/local/lib/python3.10/json/__init__.py", line 346, in loads
    return _default_decoder.decode(s)
  File "/usr/local/lib/python3.10/json/decoder.py", line 337, in decode
    obj, end = self.raw_decode(s, idx=_w(s, 0).end())
  File "/usr/local/lib/python3.10/json/decoder.py", line 355, in raw_decode
    raise JSONDecodeError("Expecting value", s, err.value) from None
json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0)

@epenet epenet added the bug Something isn't working label Feb 8, 2023
@epenet epenet merged commit c36f053 into main Feb 9, 2023
@epenet epenet deleted the gigya-JSONDecodeError branch February 9, 2023 06:56
frenck pushed a commit to home-assistant/core that referenced this pull request Feb 9, 2023
AlePerla pushed a commit to AlePerla/homeassistant_core that referenced this pull request Feb 10, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant