masque/masque/error.py

40 lines
823 B
Python
Raw Normal View History

class MasqueError(Exception):
2016-03-15 19:12:39 -07:00
"""
Parent exception for all Masque-related Exceptions
2016-03-15 19:12:39 -07:00
"""
pass
2016-03-15 19:12:39 -07:00
2019-12-12 00:38:11 -08:00
class PatternError(MasqueError):
"""
Exception for Pattern objects and their contents
"""
pass
2019-12-12 00:38:11 -08:00
2020-09-26 17:37:23 -07:00
class LibraryError(MasqueError):
2020-09-26 17:37:23 -07:00
"""
Exception raised by Library classes
"""
pass
class BuildError(MasqueError):
"""
Exception raised by builder-related functions
"""
pass
class PortError(MasqueError):
"""
Exception raised by builder-related functions
"""
pass
2023-04-07 16:33:23 -07:00
class OneShotError(MasqueError):
"""
Exception raised when a function decorated with `@oneshot` is called more than once
"""
def __init__(self, func_name: str) -> None:
Exception.__init__(self, f'Function "{func_name}" with @oneshot was called more than once')