Skip to content

AttributeError: 'HTTPError' object has no attribute 'get' #18

@muthyas

Description

@muthyas

When I run the get_availability_by_district for let's say, for next 15 days, one query after the other, I get the below error and program crashes out.

File "cowin.py", line 33, in job
available_centers = cowin.get_availability_by_district(district_id, date.strftime("%d-%m-%Y"), min_age_limit)
File "/Users/sm/Library/Python/3.8/lib/python/site-packages/cowin_api/api.py", line 49, in get_availability_by_district
return self.get_availability_by_base(caller='district', areas=district_id,
File "/Users/sm/Library/Python/3.8/lib/python/site-packages/cowin_api/api.py", line 35, in get_availability_by_base
curr_result = filter_centers_by_age_limit(self._call_api(url),
File "/Users/sm/Library/Python/3.8/lib/python/site-packages/cowin_api/utils.py", line 11, in filter_centers_by_age_limit
original_centers = centers.get('centers')
AttributeError: 'HTTPError' object has no attribute 'get'

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions