Skip to content

http status codes not passed back to caller #408

@mzizzi

Description

@mzizzi

In some cases it's useful for the caller to know the underlying http status code returned by requests. As of now, status codes never make their way back to the caller. This makes it difficult to decide how to proceed after a failed request. Just about every error that the API could throw is wrapped in something like {'errors': [...]}. This is fine for some use cases but unless we know every possible message that might end up in that datastruct we'll have a hard time knowing exactly how to proceed.

There is the option to set datadog.api._mute = False which will cause exceptions to bubble up to the caller. But in this case, things like ApiError are too broad to take make decisions on. e.g. I may wish to never retry a failed request due to a 403 or 404 but I certainly want to retry a request with that has failed with a 429.

#378 is related in that it's asking for a little more detail on failed requests. Maybe we pass both status codes and relevant headers back to the caller?

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions