(fn)
| 12 | |
| 13 | |
| 14 | def 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 | |
| 29 | class CallbackOnException: |
nothing calls this directly
no outgoing calls
no test coverage detected