def _send_500(connection, message): response = JsonResponse() response.status = 500 response.content = {'message': message} http_response = response.get_http() connection.send(http_response)
def _send_404(connection): response = JsonResponse() response.status = 404 response.content = {'message': '404 Not Found'} http_response = response.get_http() connection.send(http_response)