Commit d864a94e authored by ibuler's avatar ibuler

[Update] 添加debug信息

parent 6297328b
......@@ -191,6 +191,7 @@ class Coco:
check_session_idle_too_long(s)
except Exception as e:
logger.error("Unexpected error occur: {}".format(e))
logger.error(e, exc_info=True)
time.sleep(interval)
thread = threading.Thread(target=func)
thread.start()
......
......@@ -110,9 +110,7 @@ class ElFinderConnector:
func()
except Exception as e:
self.response['error'] = '%s' % e
logger.error("Error occur ------------------------------")
logger.exception(e)
logger.error("Error end ------------------------------")
logger.error(e, exc_info=True)
def get_request_data(self):
data_source = {}
......
......@@ -87,6 +87,7 @@ class ProxyNamespace(BaseNamespace):
forwarder.proxy()
except Exception as e:
logger.error("Unexpected error occur: {}".format(e))
logger.error(e, exc_info=True)
self.logout(client_id, connection)
self.socketio.start_background_task(proxy)
......@@ -175,7 +176,7 @@ class ProxyNamespace(BaseNamespace):
try:
self.on_logout(client_id)
except Exception as e:
logger.warn(e)
logger.error(e, exc_info=True)
Connection.remove_connection(connection.id)
def logout(self, client_id, connection):
......
......@@ -326,7 +326,7 @@ class BaseServer(object):
self.s_parse_input_output_filter(data)
data = self.s_filter_cmd_filter(data)
except Exception as e:
logger.exception(e)
logger.error(e, exc_info=True)
return self.chan.send(data)
def recv(self, size):
......
......@@ -35,6 +35,7 @@ def convert_error(func):
error = e
response = SFTP_EOF
except Exception as e:
logger.error(e, exc_info=True)
error = e
response = SFTP_FAILURE
finally:
......
......@@ -102,6 +102,7 @@ class SSHServer:
logger.warning("Handle connection EOF Error: {}".format(e))
except Exception as e:
logger.error("Unexpect error occur on handle connection: {}".format(e))
logger.error(e, exc_info=True)
finally:
Connection.remove_connection(connection.id)
sock.close()
......
......@@ -463,7 +463,7 @@ def ignore_error(func):
resp = func(*args, **kwargs)
return resp
except Exception as e:
logger.error("Error occur: {} {}".format(func.__name__, e))
logger.error(e, exc_info=True)
return wrapper
......
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