Skip to content

RateLimitException Handling fails #331

@ian-gavurin

Description

@ian-gavurin

A long standing solution using this library seems to be failing to handle RateLimit violations.
It has explicit (tested and previously working) handling which makes use of FitbitRateLimitException when its thrown from FitbitClient.HandleResponse.

However, the response I'm currently seeing isn't compatible with the ApiError type, so can't be deserialised, and throws from JsonDotNetSerializer.
{ "error": { "code": 429, "message": "Resource has been exhausted (e.g. check quota).", "status": "RESOURCE_EXHAUSTED" } }
It also seems the "Retry-After" header isn't present, so the 429 handler would be ignored anyway.

What I'm not sure about is when this broke - as mentioned above, this used to work, so I'm not sure if something has changed in the API response? Fitbit documentation doesn't seem indicate this response should be different to other errors...

[Updated after a bit more digging]

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