Skip to content

Commit

Permalink
Make MesopException the parent class of more specific mesop exception…
Browse files Browse the repository at this point in the history
…s & expose as public API (#113)
  • Loading branch information
wwwillchen authored Apr 13, 2024
1 parent f6c81e4 commit 5457ce5
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 3 deletions.
12 changes: 12 additions & 0 deletions mesop/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,18 @@
from mesop.events import (
InputEvent as InputEvent,
)
from mesop.exceptions import (
MesopDeveloperException as MesopDeveloperException,
)
from mesop.exceptions import (
MesopException as MesopException,
)
from mesop.exceptions import (
MesopInternalException as MesopInternalException,
)
from mesop.exceptions import (
MesopUserException as MesopUserException,
)
from mesop.features import page as page
from mesop.key import Key as Key
from mesop.pip_package.version import VERSION
Expand Down
6 changes: 3 additions & 3 deletions mesop/exceptions/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,16 +5,16 @@ class MesopException(Exception):
pass


class MesopUserException(Exception):
class MesopUserException(MesopException):
def __str__(self):
return f"**User Error:** {super().__str__()}"


class MesopInternalException(Exception):
class MesopInternalException(MesopException):
def __str__(self):
return f"**Mesop Internal Error:** {super().__str__()}"


class MesopDeveloperException(Exception):
class MesopDeveloperException(MesopException):
def __str__(self):
return f"**Mesop Developer Error:** {super().__str__()}"

0 comments on commit 5457ce5

Please sign in to comment.