Conversation
5ebcc3a to
88bc331
Compare
| @@ -0,0 +1 @@ | |||
| Add more Pulp Exceptions. | |||
There was a problem hiding this comment.
This is not a bug, but rather a feature.
| Stage, | ||
| ) | ||
|
|
||
| from pulp_python.app.exceptions import UnsupportedProtocolError |
There was a problem hiding this comment.
Why do we need this? I do not remember that is was reported by CI. It also looks like sth that should be in pulpcore.
| filename = data["relative_path"] | ||
| except KeyError: | ||
| raise serializers.ValidationError(detail={"relative_path": _("This field is required")}) | ||
| raise ValidationError(_("This field is required: relative_path")) |
There was a problem hiding this comment.
Why do we need this? (not reported by CI)
There was a problem hiding this comment.
We need this to give more information to user/services team. As this exception can't contain any sensitive information we would rather display it to user for easier debugging (serializers.ValidationError will be sanitized)
There was a problem hiding this comment.
Discussed on the call that we might want to turn more exceptions into PulpException-based exceptions to avoid later sanitization in core 3.115.
| return ( | ||
| f"[{self.error_code}] " | ||
| + _( | ||
| "Found duplicate packages being added with the same filename but different checksums. " # noqa: E501 | ||
| ) | ||
| + _("To allow this, set 'allow_package_substitution' to True on the repository. ") | ||
| + _("Conflicting packages: {duplicates}").format(duplicates=self.duplicates) | ||
| ) |
There was a problem hiding this comment.
return f"[{self.error_code}] " + _(
"Found duplicate packages being added with the same filename but different "
"checksums. To allow this, set 'allow_package_substitution' to True on the "
"repository. Conflicting packages: {duplicates}"
).format(duplicates=self.duplicates)
| Raised when provenance verification fails. | ||
| """ | ||
|
|
||
| error_code = "PLPY0001" |
There was a problem hiding this comment.
Do we already have a naming convention for plugins? Pulpcore uses "PLP", this introduces "PLPY"
There was a problem hiding this comment.
We don't have a strict convention for plugins, but some plugins have already created exceptions with codes, so until we have a reason to make it all stricter we will go with it.
aaaf34f to
655383c
Compare
Assisted-by: Claude Sonnet 4.5 <noreply@anthropic.com>
655383c to
02b7c62
Compare
Assisted-by: Claude Sonnet 4.5 noreply@anthropic.com
📜 Checklist