File size: 307 Bytes
b758d48
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
import sys
from functools import wraps
from src.exception import MyException

def asyncHandler(fn):
    @wraps(fn)
    async def decorator(*args, **kwargs):
        try:
            return await fn(*args, **kwargs)
        except Exception as e:
            raise MyException(e, sys)
    return decorator