From 3f9cfb786ef738441090cdd234899e9ec40c0cee Mon Sep 17 00:00:00 2001 From: Aliaksei Klimau Date: Wed, 3 Jun 2026 16:36:48 +0200 Subject: [PATCH] Add a new PulpException --- pulpcore/exceptions/__init__.py | 1 + pulpcore/exceptions/base.py | 15 +++++++++++++++ pulpcore/plugin/exceptions.py | 2 ++ 3 files changed, 18 insertions(+) diff --git a/pulpcore/exceptions/__init__.py b/pulpcore/exceptions/__init__.py index cb334f28e2f..819b4a555b4 100644 --- a/pulpcore/exceptions/__init__.py +++ b/pulpcore/exceptions/__init__.py @@ -23,6 +23,7 @@ HttpResponseError, SslConnectionError, RemoteConnectionError, + FeatureNotImplementedError, ) from .validation import ( ContentOverwriteError, diff --git a/pulpcore/exceptions/base.py b/pulpcore/exceptions/base.py index 8873f529a24..68334321418 100644 --- a/pulpcore/exceptions/base.py +++ b/pulpcore/exceptions/base.py @@ -430,3 +430,18 @@ def __str__(self): return f"[{self.error_code}] " + _("Connection failed for {url}: {details}").format( url=self.url, details=self.details ) + + +class FeatureNotImplementedError(PulpException): + """ + Raised when a requested feature is not yet implemented. + """ + + error_code = "PLP0028" + + def __init__(self, message): + super().__init__() + self.message = message + + def __str__(self): + return f"[{self.error_code}] {self.message}" diff --git a/pulpcore/plugin/exceptions.py b/pulpcore/plugin/exceptions.py index 61f218be3a1..746d2520c67 100644 --- a/pulpcore/plugin/exceptions.py +++ b/pulpcore/plugin/exceptions.py @@ -2,6 +2,7 @@ ContentOverwriteError, DigestValidationError, ExternalServiceError, + FeatureNotImplementedError, HttpResponseError, InvalidSignatureError, MissingDigestValidationError, @@ -22,6 +23,7 @@ "ContentOverwriteError", "ValidationError", "DigestValidationError", + "FeatureNotImplementedError", "InvalidSignatureError", "PulpException", "SizeValidationError",