Skip to content

Commit

Permalink
chore: improve decide exception (#31)
Browse files Browse the repository at this point in the history
  • Loading branch information
maxi-indicina authored Jun 8, 2023
2 parents aa92ffc + de4e7bd commit af8635a
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions decide/models/error.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,13 @@


class DecideException(Exception):

def __init__(self, *args: Any, **kwargs: Any) -> None:
extra = ""
if args:
extra = f"\n| extra info: {args[0]}"
print(f"[{self.__class__.__name__}]: {self.__doc__}{extra}")
Exception.__init__(self, *args)
def __init__(self, message, **kwargs):
self.message = message
self.additional_info = kwargs

def __str__(self):
_ = ', '.join(f"{key}={value}" for key, value in self.additional_info.items())
return f"{self.message}"


class IllegalAssignmentException(DecideException):
Expand Down

0 comments on commit af8635a

Please sign in to comment.