Bug: __parse_headers
need to handle KeyErrors
#9
agatha
commented 2023-11-11 20:31:18 +00:00
Owner
```
Traceback (most recent call last):
File "/home/user/data/projects/gitmon/main.py", line 39, in <module>
main()
File "/home/user/data/projects/gitmon/main.py", line 30, in main
events = api.get_events()
^^^^^^^^^^^^^^^^
File "/home/user/data/projects/gitmon/gitmon/api.py", line 95, in get_events
events = self.__get(endpoint, params)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/user/data/projects/gitmon/gitmon/api.py", line 65, in __get
self.__parse_headers(response.headers)
File "/home/user/data/projects/gitmon/gitmon/api.py", line 75, in __parse_headers
self.rate_reset = datetime.fromtimestamp(int(headers['x-ratelimit-reset']))
~~~~~~~^^^^^^^^^^^^^^^^^^^^^
File "/home/user/data/projects/gitmon/venv/lib/python3.11/site-packages/requests/structures.py", line 52, in __getitem__
return self._store[key.lower()][1]
~~~~~~~~~~~^^^^^^^^^^^^^
KeyError: 'x-ratelimit-reset'
```
agatha
referenced this issue from a commit 2023-11-11 20:33:22 +00:00
Handle KeyErrors in __parse_headers. Closes #9
agatha
closed this issue 2023-11-11 20:33:22 +00:00
Loading…
Reference in New Issue
Block a user
No description provided.
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?