Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Abstract adding json respone to error message #1224

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

dosas
Copy link
Collaborator

@dosas dosas commented Sep 2, 2024

Description of changes

The output of raise_for_status is not really descriptive for since the actual error message is not part of the exception.

This commit exapnds on 95b3ce1

Adds existing solution to all raise_for_status calls.

Functional demonstration

Example:

requests.exceptions.HTTPError: ('500 Server Error: Internal Server Error for url: https://robo-main-orcharhino-alma8.infra.dev.atix/katello/api/v2/repositories/42', {'displayMessage': 'Repository cannot be deleted since it has already been included in a published Content View. Please delete all Content View versions containing this repository before attempting to delete it or use --remove-from-content-view-versions flag to automatically remove the repository from all published versions.', 'errors': ['Repository cannot be deleted since it has already been included in a published Content View. Please delete all Content View versions containing this repository before attempting to delete it or use --remove-from-content-view-versions flag to automatically remove the repository from all published versions.']})

vs.

requests.exceptions.HTTPError: 500 Server Error: Internal Server Error for url: https://robo-main-orcharhino-alma8.infra.dev.atix/katello/api/v2/repositories/24

The output of raise_for_status is not really descriptive
for since the actual error message is not part of the
exception.

This commit exapnds on 95b3ce1

Adds existing solution to all raise_for_status calls.
@dosas dosas added CherryPick PR needs CherryPick to previous branches 6.14.z 6.15.z 6.16.z labels Sep 2, 2024
@omkarkhatavkar
Copy link
Contributor

Can one of the admins verify this patch?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
6.14.z 6.15.z 6.16.z CherryPick PR needs CherryPick to previous branches
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants