Skip to content

Commit

Permalink
Improve exception handling
Browse files Browse the repository at this point in the history
Report any exception as ERROR and send traceback as DEBUG
  • Loading branch information
Lykos153 committed Nov 21, 2020
1 parent f5529bd commit 4a634cb
Showing 1 changed file with 6 additions and 7 deletions.
13 changes: 6 additions & 7 deletions annexremote/annexremote.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@

from abc import ABCMeta, abstractmethod

import sys
import sys, traceback
import string


Expand Down Expand Up @@ -860,14 +860,13 @@ def Listen(self, input=sys.stdin):
reply = self.protocol.command(line)
if reply:
self._send(reply)
except (UnsupportedRequest):
except UnsupportedRequest:
self._send ("UNSUPPORTED-REQUEST")
except (NotImplementedError):
self._send ("ERROR not yet implemented")
except Exception as e:
for line in traceback.format_exc().splitlines():
self.debug(line)
self.error(e)
raise SystemExit
#except Exception as e:
# self._send ("ERROR", e)
# raise SystemExit

def _ask(self, request, reply_keyword, reply_count):
self._send(request)
Expand Down

0 comments on commit 4a634cb

Please sign in to comment.