Skip to content

Commit cedb4bc

Browse files
aKlimaudralley
authored andcommitted
Add a new PulpException
1 parent 47bb6c3 commit cedb4bc

3 files changed

Lines changed: 18 additions & 0 deletions

File tree

pulpcore/exceptions/__init__.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@
2323
HttpResponseError,
2424
SslConnectionError,
2525
RemoteConnectionError,
26+
FeatureNotImplementedError,
2627
)
2728
from .validation import (
2829
ContentOverwriteError,

pulpcore/exceptions/base.py

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -430,3 +430,18 @@ def __str__(self):
430430
return f"[{self.error_code}] " + _("Connection failed for {url}: {details}").format(
431431
url=self.url, details=self.details
432432
)
433+
434+
435+
class FeatureNotImplementedError(PulpException):
436+
"""
437+
Raised when a requested feature is not yet implemented.
438+
"""
439+
440+
error_code = "PLP0028"
441+
442+
def __init__(self, message):
443+
super().__init__()
444+
self.message = message
445+
446+
def __str__(self):
447+
return f"[{self.error_code}] {self.message}"

pulpcore/plugin/exceptions.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
ContentOverwriteError,
33
DigestValidationError,
44
ExternalServiceError,
5+
FeatureNotImplementedError,
56
HttpResponseError,
67
InvalidSignatureError,
78
MissingDigestValidationError,
@@ -22,6 +23,7 @@
2223
"ContentOverwriteError",
2324
"ValidationError",
2425
"DigestValidationError",
26+
"FeatureNotImplementedError",
2527
"InvalidSignatureError",
2628
"PulpException",
2729
"SizeValidationError",

0 commit comments

Comments
 (0)