ML-Learner / server /src /utils /asyncHandler.py
VashuTheGreat2's picture
Upload folder using huggingface_hub
0225ffc verified
Raw History Blame Contribute Delete
303 Bytes
from functools import wraps
import logging
def asyncHandler(fn):
@wraps(fn)
async def decorator(*args, **kwargs):
try:
return await fn(*args, **kwargs)
except Exception as e:
logging.exception("Unhandled exception")
raise
return decorator