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

Handle empty cookie jar #27

Open
TomBrien opened this issue Mar 9, 2022 · 0 comments
Open

Handle empty cookie jar #27

TomBrien opened this issue Mar 9, 2022 · 0 comments

Comments

@TomBrien
Copy link
Owner

TomBrien commented Mar 9, 2022

2022-03-09 12:08:40 DEBUG (SyncWorker_1) [cardiffwaste.cardiffwaste] Starting sorting bins
2022-03-09 12:08:40 DEBUG (SyncWorker_1) [cardiffwaste.cardiffwaste] Requesting JWT
2022-03-09 12:08:40 DEBUG (SyncWorker_1) [cardiffwaste.cardiffwaste] Completed JWT request with status code: 200
2022-03-09 12:08:40 DEBUG (SyncWorker_1) [cardiffwaste.cardiffwaste] Attempting to get collection cookies
2022-03-09 12:08:40 DEBUG (SyncWorker_1) [cardiffwaste.cardiffwaste] Received 0 cookies
2022-03-09 12:08:40 DEBUG (SyncWorker_1) [cardiffwaste.cardiffwaste] Attempting to get collection data
2022-03-09 12:08:40 DEBUG (SyncWorker_1) [cardiffwaste.cardiffwaste] Completed collection data request with status code: 502
2022-03-09 12:08:40 ERROR (MainThread) [custom_components.cardiffwaste] Unexpected error fetching cardiffwaste data: Expecting value: line 1 column 1 (char 0)
Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/helpers/update_coordinator.py", line 187, in _async_refresh
self.data = await self._async_update_data()
File "/config/custom_components/cardiffwaste/__init__.py", line 111, in _async_update_data
return await self._hass.async_add_executor_job(
File "/usr/local/lib/python3.9/concurrent/futures/thread.py", line 58, in run
result = self.fn(*self.args, **self.kwargs)
File "/usr/local/lib/python3.9/site-packages/cardiffwaste/cardiffwaste.py", line 201, in get_next_collections
response = self.get_raw_collections()
File "/usr/local/lib/python3.9/site-packages/cardiffwaste/cardiffwaste.py", line 166, in get_raw_collections
raw["collections"] = json.loads(response.text)["collectionWeeks"]
File "/usr/local/lib/python3.9/json/__init__.py", line 346, in loads
return _default_decoder.decode(s)
File "/usr/local/lib/python3.9/json/decoder.py", line 337, in decode
obj, end = self.raw_decode(s, idx=_w(s, 0).end())
File "/usr/local/lib/python3.9/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)
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