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