Ejemplo n.º 1
0
def generic_exception_handler(error):
    """
        Prevents Exceptions flying all around the place.
    """
    response = None
    app.logger.exception(error)
    response = response_map.map_exception(error)

    return response
Ejemplo n.º 2
0
        def wrapper(container, *args, **kwargs):
            try:
                if not container.permissions_validator.allowed():
                    response = None
                    if container.context.has_error():
                        response = response_map.map_context_error(container.context)
                    else:
                        response = response_map.create_401()

                    return response
            except BucketNotFoundError as e:
                return response_map.map_exception(e)

            return func(container, *args, **kwargs)
Ejemplo n.º 3
0
        def wrapper(container, *args, **kwargs):
            try:
                if not container.permissions_validator.allowed():
                    response = None
                    if container.context.has_error():
                        response = response_map.map_context_error(
                            container.context)
                    else:
                        response = response_map.create_401()

                    return response
            except BucketNotFoundError as e:
                return response_map.map_exception(e)

            return func(container, *args, **kwargs)