MCPcopy Create free account
hub / github.com/InternRobotics/G2VLM / catch_exception

Function catch_exception

eval_code/recons/models/moge/utils/tools.py:14–26  ·  view source on GitHub ↗
(fn)

Source from the content-addressed store, hash-verified

12
13
14def catch_exception(fn):
15 @wraps(fn)
16 def wrapper(*args, **kwargs):
17 try:
18 return fn(*args, **kwargs)
19 except Exception as e:
20 import traceback
21 print(f"Exception in {fn.__name__}", end='r')
22 # print({', '.join(repr(arg) for arg in args)}, {', '.join(f'{k}={v!r}' for k, v in kwargs.items())})
23 traceback.print_exc(chain=False)
24 time.sleep(0.1)
25 return None
26 return wrapper
27
28
29class CallbackOnException:

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected