Commit 9aebb6e4 by Sheng

Updated write_error

parent daa24021
...@@ -78,14 +78,14 @@ class IndexHandler(MixinHandler, tornado.web.RequestHandler): ...@@ -78,14 +78,14 @@ class IndexHandler(MixinHandler, tornado.web.RequestHandler):
if not swallow_http_errors: if not swallow_http_errors:
super(MixinHandler, self).write_error(status_code, **kwargs) super(MixinHandler, self).write_error(status_code, **kwargs)
else: else:
if status_code == 500:
self._reason = 'Internal Server Error'
else:
exc_info = kwargs.get('exc_info') exc_info = kwargs.get('exc_info')
if exc_info: if exc_info:
self._reason = exc_info[1].log_message reason = getattr(exc_info[1], 'log_message', None)
if reason:
self._reason = reason
self.result.update(status=self._reason) self.result.update(status=self._reason)
self.set_status(200) self.set_status(200)
self.set_header('Server', 'TornadoServer')
self.finish(self.result) self.finish(self.result)
def get_ssh_client(self): def get_ssh_client(self):
......
...@@ -189,7 +189,7 @@ jQuery(function($){ ...@@ -189,7 +189,7 @@ jQuery(function($){
} }
var msg = resp.responseJSON; var msg = resp.responseJSON;
if (msg.status) { if (!msg.id) {
log_status(msg.status); log_status(msg.status);
state = DISCONNECTED; state = DISCONNECTED;
return; return;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment