Exemple #1
0
def handle_exception(request, exception):
    return json(jsonapi.error(exception, 'Unexpected Behavior'),
                status=HTTPStatus.BAD_REQUEST)
Exemple #2
0
def handle_resource_not_found(request, exception):
    return json(jsonapi.error(exception, 'Resource not found'),
                status=HTTPStatus.NOT_FOUND)
Exemple #3
0
def handle_exchange_error(request, exception):
    return json(jsonapi.error(exception, 'Exchange Error'),
                status=HTTPStatus.UNPROCESSABLE_ENTITY)
Exemple #4
0
def handle_invalid_order(request, exception):
    return json(jsonapi.error(exception, 'Min Order Amount'),
                status=HTTPStatus.NOT_ACCEPTABLE)
Exemple #5
0
def handle_invalid_order(request, exception):
    return json(jsonapi.error(exception, 'Invalid Order'),
                status=HTTPStatus.UNPROCESSABLE_ENTITY)
Exemple #6
0
def handle_order_not_found(request, exception):
    return json(jsonapi.error(exception, 'Order Not Found'),
                status=HTTPStatus.NOT_FOUND)