Skip to content

retry-at attribute of the rateLimit object is missing in the error data response #207

@mauromanfrin

Description

@mauromanfrin

The class ForecastSolarRatelimitError takes the data reposnse and extracts the object rateLimit from which it extracts the retry-at attribute:

super().__init__(data)

self.reset_at = datetime.fromisoformat(data["ratelimit"]["retry-at"])]

Well, the retry-at attribute is completely missing from the response hence during the raise of the ForecastSolarRatelimitError, another error KeyError is raised.

Here's an example of the data structure:
{'code': 429, 'info': [], 'pid': 'bT2839f9', 'ratelimit': {'limit': 12, 'period': 3600, 'zone': 'IP 161.31.124.95'}, 'text': 'Rate limit for API calls reached.', 'type': 'error'}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions