add @oneshot decorator
This commit is contained in:
parent
d7e89ef5c8
commit
46a7f60460
1 changed files with 29 additions and 0 deletions
|
|
@ -30,3 +30,10 @@ class PortError(MasqueError):
|
|||
Exception raised by builder-related functions
|
||||
"""
|
||||
pass
|
||||
|
||||
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')
|
||||
|
|
|
|||
Loading…
Reference in a new issue