diff options
| author | 2019-10-25 14:14:30 +0100 | |
|---|---|---|
| committer | 2019-10-25 14:14:30 +0100 | |
| commit | 7d4c6b69412ff1ce25c6e73a77d00d736845c38d (patch) | |
| tree | 8a2180789795cfe55e49c3f980c767ff0537caa2 | |
| parent | use different exit codes for every error circumstance (diff) | |
| signature | ||
bot.panic() should just call sys.exit()
| -rw-r--r-- | src/IRCBot.py | 14 |
1 files changed, 1 insertions, 13 deletions
diff --git a/src/IRCBot.py b/src/IRCBot.py index e2868744..762676bb 100644 --- a/src/IRCBot.py +++ b/src/IRCBot.py @@ -21,9 +21,6 @@ class TriggerEvent(object): self.type = type self.callback = callback -class BitBotPanic(Exception): - pass - class ListLambdaPollHook(PollHook.PollHook): def __init__(self, collection: typing.Callable[[], typing.Iterable[typing.Any]], @@ -146,9 +143,7 @@ class Bot(object): if not reason == None: self.log.critical("panic() called: %s", [reason], exc_info=True) - self._event_queue.put(TriggerEvent(TriggerEventType.Kill)) - if throw: - raise BitBotPanic() + sys.exit(20) def _module_lists(self): db_whitelist = set(self.get_setting("module-whitelist", [])) @@ -269,11 +264,6 @@ class Bot(object): return thread def run(self): - try: - self._run() - except BitBotPanic: - return - def _run(self): self._writing = True self._reading = True @@ -334,8 +324,6 @@ class Bot(object): def _loop_catch(self, name: str, loop: typing.Callable[[], None]): try: loop() - except BitBotPanic: - return except Exception as e: self.panic("Exception on '%s' thread" % name, throw=False) |
