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
Descriptive error for RPM with invalid metadata #1510
Conversation
6d1c751
to
8523457
Compare
pulp_rpm/app/tasks/synchronizing.py
Outdated
missing_type = set(PACKAGE_REPODATA) - main_types | ||
if missing_type: | ||
raise FileNotFoundError(_("XML file(s): {filename} not found".format( | ||
filename=", ".join(missing_type)))) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This needs to be _("XML file(s): {filename} not found").format(...)
CHANGES/4424.misc
Outdated
@@ -0,0 +1 @@ | |||
Providing a descriptive error message for RPM repos with invalid metadata |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Probably not a misc
changelog entry.
pulp_rpm/app/tasks/synchronizing.py
Outdated
try: | ||
results = downloader.result() | ||
except ClientResponseError as exc: | ||
raise HTTPNotFound(reason=f"File not found: {exc.request_info.url}") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this needs to be internationalized, no?
pulp_rpm/app/tasks/synchronizing.py
Outdated
try: | ||
results = downloader.result() | ||
except ClientResponseError as exc: | ||
raise HTTPNotFound(reason=_(f"File not found: {exc.request_info.url}")) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You can't use f strings and gettext as the string will be interpreted before it gets translated.
https://pulp.plan.io/issues/4424
closes #4424