Spaces:
Sleeping
Sleeping
Download server/src/utils/asyncHandler.py from VashuTheGreat2/ML-Learner: direct link, hf CLI and curl.
- Browser
- Download file 303 Bytes
-
https://huggingface.co/spaces/VashuTheGreat2/ML-Learner/resolve/main/server/src/utils/asyncHandler.py
- Command line
-
hf download hf://spaces/VashuTheGreat2/ML-Learner/server/src/utils/asyncHandler.py
-
curl -L -o asyncHandler.py https://huggingface.co/spaces/VashuTheGreat2/ML-Learner/resolve/main/server/src/utils/asyncHandler.py
303 Bytes
| from functools import wraps | |
| import logging | |
| def asyncHandler(fn): | |
| async def decorator(*args, **kwargs): | |
| try: | |
| return await fn(*args, **kwargs) | |
| except Exception as e: | |
| logging.exception("Unhandled exception") | |
| raise | |
| return decorator |