Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- class Error(Exception):
- """Base class for exceptions in this module."""
- pass
- class InputError(Error):
- """Exception raised for errors in the input.
- Attributes:
- expression -- input expression in which the error occurred
- message -- explanation of the error
- """
- def __init__(self, expression, message):
- self.expression = expression
- self.message = message
- class TransitionError(Error):
- """Raised when an operation attempts a state transition that's not
- allowed.
- Attributes:
- previous -- state at beginning of transition
- next -- attempted new state
- message -- explanation of why the specific transition is not allowed
- """
- def __init__(self, previous, next, message):
- self.previous = previous
- self.next = next
- self.message = message
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement