Just a bit extra error handling
This commit is contained in:
parent
7fd142483f
commit
65191f2f76
1 changed files with 6 additions and 1 deletions
|
@ -361,4 +361,9 @@ class Session():
|
||||||
if fn is None:
|
if fn is None:
|
||||||
return self.respond(ResponseCode.NNTP_COMMAND_UNKNOWN)
|
return self.respond(ResponseCode.NNTP_COMMAND_UNKNOWN)
|
||||||
|
|
||||||
|
try:
|
||||||
return fn(self, *args)
|
return fn(self, *args)
|
||||||
|
except TypeError as e:
|
||||||
|
return self.respond(ResponseCode.NNTP_SYNTAX_ERROR)
|
||||||
|
except Exception as e:
|
||||||
|
return self.respond(ResponseCode.NNTP_COMMAND_UNAVAILABLE)
|
||||||
|
|
Loading…
Add table
Reference in a new issue