def wrapedFunction(*args, **kwargs): try: functionReturn = function(*args, **kwargs) except Exception as exception: functionName = ReflectionHelper.getName(function, typeName=c.TYPE_FUNCTION) LogHelper.wraper( Function, f'''Failed to execute "{functionName}(args={args}, kwargs={kwargs})" {c.TYPE_FUNCTION} call''', exception) raise exception return functionReturn
def wrapedMethod(*args, **kwargs): try: methodReturn = method(*args, **kwargs) except Exception as exception: className = ReflectionHelper.getClassName(args[0].__class__, typeClass=c.TYPE_CLASS) methodName = ReflectionHelper.getClassName(method, typeClass=c.TYPE_METHOD) LogHelper.wraper( Method, f'''Failed to execute "{className}{c.DOT}{methodName}(args={args}, kwargs={kwargs})" {c.TYPE_METHOD} call''', exception) raise exception return methodReturn