What is @error_wrap in above of some functions in python?
such as below code:
@error_wrap
def disconnect(self):
"""
disconnect a client.
"""
logger.info("disconnecting snap7 client")
return self.library.Cli_Disconnect(self.pointer)
error_wrap method:
def error_wrap(func):
"""Parses a s7 error code returned the decorated function."""
def f(*args, **kw):
code = func(*args, **kw)
check_error(code, context="client")
return f
I know about several OOP decorated python functions, (i.e. @staticmethod, @classmethod, @abstractmethod and etc), but I can't find about @error_wrap.
What is equivalent mentioned these codes?