MCPcopy Create free account
hub / github.com/MAC-VO/MAC-VO / wrapped

Function wrapped

Utility/Utils.py:149–158  ·  view source on GitHub ↗
(*args, **kwargs)

Source from the content-addressed store, hash-verified

147def IgnoreException(func: Callable[T_In, T_Out]) -> Callable[T_In, Optional[T_Out]]:
148 @wraps(func)
149 def wrapped(*args, **kwargs) -> Optional[T_Out]:
150 try:
151 result = func(*args, **kwargs)
152 except KeyboardInterrupt as e:
153 raise e from None
154 except Exception as e:
155 Logger.show_exception()
156 Logger.write("warn", f"Failed to execute function {func.__name__} due to exception:\n{e}")
157 result = None
158 return result
159 return wrapped
160
161def tensor_safe_asdict(obj):

Callers

nothing calls this directly

Calls 2

show_exceptionMethod · 0.80
writeMethod · 0.80

Tested by

no test coverage detected