From e646d0ee4cab2b4ec77004f1eacdc5854af581e9 Mon Sep 17 00:00:00 2001 From: Robey Pointer Date: Sat, 29 Apr 2006 19:32:38 -0700 Subject: [PATCH] [project @ robey@lag.net-20060430023238-3cd706d10c2de472] try to clean up if the server object throws an exception --- paramiko/sftp_server.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/paramiko/sftp_server.py b/paramiko/sftp_server.py index 86faad3..fefb963 100644 --- a/paramiko/sftp_server.py +++ b/paramiko/sftp_server.py @@ -92,7 +92,13 @@ class SFTPServer (BaseSFTP, SubsystemHandler): return msg = Message(data) request_number = msg.get_int() - self._process(t, request_number, msg) + try: + self._process(t, request_number, msg) + except Exception, e: + self._log(DEBUG, 'Exception in server processing: ' + str(e)) + self._log(DEBUG, util.tb_strings()) + # send some kind of failure message, at least + self._send_status(request_number, SFTP_FAILURE) def finish_subsystem(self): self.server.session_ended()