MCPcopy Create free account
hub / github.com/StackStorm/st2 / wrapper

Function wrapper

st2common/st2common/util/misc.py:214–224  ·  view source on GitHub ↗
(*args, **kwargs)

Source from the content-addressed store, hash-verified

212 def decorator(func):
213 @functools.wraps(func)
214 def wrapper(*args, **kwargs):
215 try:
216 return func(*args, **kwargs)
217 except exc_classes as e:
218 if len(args) >= 1 and getattr(args[0], "__class__", None):
219 func_name = "%s.%s" % (args[0].__class__.__name__, func.__name__)
220 else:
221 func_name = func.__name__
222
223 message = 'Exception in fuction "%s": %s' % (func_name, str(e))
224 logger.log(level, message)
225
226 return wrapper
227

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected