modules/backend/lambda-src/utils.py
def exception_handler(handler):
    """
    Wrapper for handling exceptions raised by the applications and converting them to error messages.
    """

    @functools.wraps(handler)
    def inner(*args, **kwargs):
        try:
            return handler(*args, **kwargs)
        except APIException as e:
            return {
                "statusCode": e.status_code,
                "body": json.dumps({"message": e.message}),
                "headers": {"Content-Type": "application/json"},
            }

    return inner

    Wrapper for handling exceptions raised by the applications and converting them to error messages.
    
Wrapper for handling exceptions raised by the applications and converting them to error messages.
Wrapper for handling exceptions raised by the applications and converting them to error messages .
def exception_handler(handler):
    @functools.wraps(handler)
    def inner(*args, **kwargs):
        try:
            return handler(*args, **kwargs)
        except APIException as e:
            return {
                "statusCode": e.status_code,
                "body": json.dumps({"message": e.message}),
                "headers": {"Content-Type": "application/json"},
            }
    return inner
def exception_handler ( handler ) : @ functools . wraps ( handler ) def inner ( * args , ** kwargs ) : try : return handler ( * args , ** kwargs ) except APIException as e : return { "statusCode" : e . status_code , "body" : json . dumps ( { "message" : e . message } ) , "headers" : { "Content-Type" : "application/json" } , } return inner
Wrapper for handling exceptions raised by the applications and converting them to error messages.
Wrapper for handling exceptions raised by the applications and converting them to error messages .
"""
    Wrapper for handling exceptions raised by the applications and converting them to error messages.
    """
handler