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

Descriptive error for RPM with invalid metadata #1510

Merged
merged 1 commit into from Nov 21, 2019
Merged

Conversation

fao89
Copy link
Member

@fao89 fao89 commented Nov 13, 2019

@fao89 fao89 force-pushed the 4424 branch 2 times, most recently from 6d1c751 to 8523457 Compare November 21, 2019 14:51
missing_type = set(PACKAGE_REPODATA) - main_types
if missing_type:
raise FileNotFoundError(_("XML file(s): {filename} not found".format(
filename=", ".join(missing_type))))
Copy link
Contributor

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(...)

@@ -0,0 +1 @@
Providing a descriptive error message for RPM repos with invalid metadata
Copy link
Contributor

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.

try:
results = downloader.result()
except ClientResponseError as exc:
raise HTTPNotFound(reason=f"File not found: {exc.request_info.url}")
Copy link
Contributor

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?

try:
results = downloader.result()
except ClientResponseError as exc:
raise HTTPNotFound(reason=_(f"File not found: {exc.request_info.url}"))
Copy link
Contributor

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants