Skip to content

Commit

Permalink
feat: add BaseError and ModelError for more granular exceptions
Browse files Browse the repository at this point in the history
Signed-off-by: Jason C. Nucciarone <[email protected]>
  • Loading branch information
NucciTheBoss committed Aug 26, 2024
1 parent d94dd45 commit a446a68
Showing 1 changed file with 14 additions and 1 deletion.
15 changes: 14 additions & 1 deletion slurmutils/exceptions.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,5 +15,18 @@
"""Exceptions raised by Slurm utilities in this package."""


class EditorError(Exception):
class BaseError(Exception):
"""Base exception for errors in `slurmutils` module."""

@property
def message(self) -> str:
"""Return message passed as argument to exception."""
return self.args[0]


class EditorError(BaseError):
"""Raise when a Slurm configuration editor encounters an error."""


class ModelError(BaseError):
"""Raise when a Slurm configuration model encounters an error."""

0 comments on commit a446a68

Please sign in to comment.