Skip to content

Including http_error as attribute in exception #445

Open
@FCamborda

Description

@FCamborda

It looks to me like the current implementation of ArtifactoryException currently only includes the http error code as part of the string message (e.g. dohq_artifactory.exception.ArtifactoryException: 502 Server Error: Bad Gateway for url: https://myserver.com/artifactory/api/storage/my-repo/path/4242/directory
Unfortunately our infrastructure is sometimes unstable so we need to retry some operations in case of some specific errors (e.g. 429).

We prefer not to parse the exception message string, as there are some numbers (IDs) in the URL and we would create a dependency to the format of your exception message.

Instead, we think that including an optional (i.e. None on initialization) http_error_code would greatly help us. That is anyway what the HTTPError of requests includes: https://github.com/psf/requests/blob/main/src/requests/exceptions.py#L22

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Help WantedWe will be glad if somebody proposes a solution via PRenhancementFeature request to extend functionality

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions