Merge "Add base exception class for this library"
This commit is contained in:
commit
a17e2ff682
@ -15,23 +15,27 @@
|
||||
# under the License.
|
||||
|
||||
|
||||
class InvalidState(Exception):
|
||||
class AutomatonException(Exception):
|
||||
"""Base class for *most* exceptions emitted from this library."""
|
||||
|
||||
|
||||
class InvalidState(AutomatonException):
|
||||
"""Raised when a invalid state transition is attempted while executing."""
|
||||
|
||||
|
||||
class NotInitialized(Exception):
|
||||
class NotInitialized(AutomatonException):
|
||||
"""Error raised when an action is attempted on a not inited machine."""
|
||||
|
||||
|
||||
class NotFound(Exception):
|
||||
class NotFound(AutomatonException):
|
||||
"""Raised when some entry in some object doesn't exist."""
|
||||
|
||||
|
||||
class Duplicate(Exception):
|
||||
class Duplicate(AutomatonException):
|
||||
"""Raised when a duplicate entry is found."""
|
||||
|
||||
|
||||
class FrozenMachine(Exception):
|
||||
class FrozenMachine(AutomatonException):
|
||||
"""Exception raised when a frozen machine is modified."""
|
||||
|
||||
def __init__(self):
|
||||
|
@ -35,3 +35,10 @@ Exceptions
|
||||
|
||||
.. automodule:: automaton.exceptions
|
||||
:members:
|
||||
|
||||
Hierarchy
|
||||
---------
|
||||
|
||||
.. inheritance-diagram::
|
||||
automaton.exceptions
|
||||
:parts: 1
|
||||
|
@ -23,7 +23,8 @@ sys.path.insert(0, os.path.abspath('../..'))
|
||||
extensions = [
|
||||
'sphinx.ext.autodoc',
|
||||
'sphinx.ext.doctest',
|
||||
'oslosphinx'
|
||||
'sphinx.ext.inheritance_diagram',
|
||||
'oslosphinx',
|
||||
]
|
||||
|
||||
# autodoc generation is a bit aggressive and a nuisance when doing heavy
|
||||
|
Loading…
x
Reference in New Issue
Block a user