Browse Source

Updated write_error

pull/38/head
Sheng 6 years ago
parent
commit
9aebb6e4e3
  1. 12
      webssh/handler.py
  2. 2
      webssh/static/js/main.js

12
webssh/handler.py

@ -78,14 +78,14 @@ class IndexHandler(MixinHandler, tornado.web.RequestHandler):
if not swallow_http_errors:
super(MixinHandler, self).write_error(status_code, **kwargs)
else:
if status_code == 500:
self._reason = 'Internal Server Error'
else:
exc_info = kwargs.get('exc_info')
if exc_info:
self._reason = exc_info[1].log_message
exc_info = kwargs.get('exc_info')
if exc_info:
reason = getattr(exc_info[1], 'log_message', None)
if reason:
self._reason = reason
self.result.update(status=self._reason)
self.set_status(200)
self.set_header('Server', 'TornadoServer')
self.finish(self.result)
def get_ssh_client(self):

2
webssh/static/js/main.js

@ -189,7 +189,7 @@ jQuery(function($){
}
var msg = resp.responseJSON;
if (msg.status) {
if (!msg.id) {
log_status(msg.status);
state = DISCONNECTED;
return;

Loading…
Cancel
Save