Skip to content

Commit

Permalink
A bit more base exception refactoring
Browse files Browse the repository at this point in the history
  • Loading branch information
jonathangreen committed Feb 23, 2024
1 parent 4bd15b5 commit 62ff512
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion core/exceptions.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ def __init__(self, message: str | None = None):
:param message: String containing description of the error occurred
"""
self.message = message
super().__init__(message)
self.message = message


class IntegrationException(BasePalaceException):
Expand Down
6 changes: 3 additions & 3 deletions core/util/problem_detail.py
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,7 @@ def __eq__(self, other: object) -> bool:
)


class BaseProblemDetailException(Exception, ABC):
class BaseProblemDetailException(BasePalaceException, ABC):
"""Mixin for exceptions that can be converted into a ProblemDetail."""

@property
Expand All @@ -160,7 +160,7 @@ def problem_detail(self) -> ProblemDetail:
...


class ProblemDetailException(BasePalaceException, BaseProblemDetailException):
class ProblemDetailException(BaseProblemDetailException):
"""Exception class allowing to raise and catch ProblemDetail objects."""

def __init__(self, problem_detail: ProblemDetail) -> None:
Expand All @@ -172,7 +172,7 @@ def __init__(self, problem_detail: ProblemDetail) -> None:
raise ValueError(
'Argument "problem_detail" must be an instance of ProblemDetail class'
)

super().__init__(problem_detail.title)
self._problem_detail = problem_detail

@property
Expand Down

0 comments on commit 62ff512

Please sign in to comment.