예제 #1
0
def _handle_500(request, response, exception):
    logging.exception(exception)
    http_util.write(
        response,
        text=json.dumps({
            'errors': [exception.message if exception else "An error occured"]
        }),
        content_type="application/json",
        status=500)
예제 #2
0
def _handle_500(request,  response,  exception):
    logging.exception(exception)
    http_util.write(response,
                    text = json.dumps({'errors' : [
                        exception.message
                        if exception
                        else "An error occured"
                    ]}),
                    content_type = "application/json",
                    status = 500)
예제 #3
0
 def write(self,text=None, status=None, content_type = None):
     http_util.write(self.response, text, status, content_type)
예제 #4
0
 def write(self, text=None, status=None, content_type=None):
     http_util.write(self.response, text, status, content_type)