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

Unexpected error fetching dae data: 'set-cookie' #1

Open
ScottG489 opened this issue May 11, 2024 · 0 comments
Open

Unexpected error fetching dae data: 'set-cookie' #1

ScottG489 opened this issue May 11, 2024 · 0 comments

Comments

@ScottG489
Copy link
Owner

We should more gracefully handle this error. Seems for some reason the response header didn't contain Set-Cookie:

Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/helpers/update_coordinator.py", line 315, in _async_refresh
    self.data = await self._async_update_data()
                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/config/custom_components/dae/coordinator.py", line 37, in _async_update_data
    return await self.hass.async_add_executor_job(self._update)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/concurrent/futures/thread.py", line 58, in run
    result = self.fn(*self.args, **self.kwargs)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/config/custom_components/dae/coordinator.py", line 33, in _update
    return self.client.get_channel_meters()
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/config/custom_components/dae/client.py", line 22, in get_channel_meters
    self.login()
  File "/config/custom_components/dae/client.py", line 39, in login
    self.auth_cookies.load(r.headers['Set-Cookie'])
                           ~~~~~~~~~^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/site-packages/requests/structures.py", line 52, in __getitem__
    return self._store[key.lower()][1]
           ~~~~~~~~~~~^^^^^^^^^^^^^
KeyError: 'set-cookie'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant