Display a basic error to IM user on uncatched exception
This commit is contained in:
parent
e915c4930c
commit
d5f07ec338
1 changed files with 5 additions and 1 deletions
|
@ -170,10 +170,14 @@ class MessageConsumer:
|
|||
# Run post-treatment: from Response to [ Response ]
|
||||
if self.responses is not None and len(self.responses) > 0:
|
||||
self.post_treat(context.hooks)
|
||||
except:
|
||||
except BaseException as e:
|
||||
logger.exception("Error occurred during the processing of the %s: "
|
||||
"%s", type(self.msgs[0]).__name__, self.msgs[0])
|
||||
|
||||
from nemubot.message import Text
|
||||
self.responses.append(Text("Sorry, an error occured (%s). Feel free to open a new issue at https://github.com/nemunaire/nemubot/issues/new" % type(e).__name__,
|
||||
server=self.srv.id, to=self.msgs[0].to_response))
|
||||
|
||||
for res in self.responses:
|
||||
to_server = None
|
||||
if isinstance(res, str):
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue