Skip to content

Error Type getting lost in send_request if error.message is an empty string #339

@MRigal

Description

@MRigal

Hi,

For some reason, the "message" attribute seems not to be set or to be an empty strings for httpx TimeoutExceptions.
Thus, using

except httpx.HTTPError as e:
            raise exc_class(str(e)) from e

will also set an empty string and it is not very helpful to distinguish the errors occuring. Replacing by the following already helps.

except httpx.HTTPError as e:
            raise exc_class(str(e) or e.__class__.__name__) from e

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