Catch NotImplementedError when sending messages

(RPC should not crash your bot!)
This commit is contained in:
Matthias 2019-08-30 07:02:26 +02:00
parent b6b7dcd61c
commit d977695d48

View File

@ -56,7 +56,10 @@ class RPCManager(object):
logger.info('Sending rpc message: %s', msg)
for mod in self.registered_modules:
logger.debug('Forwarding message to rpc.%s', mod.name)
mod.send_msg(msg)
try:
mod.send_msg(msg)
except NotImplementedError:
logger.error(f"Message type {msg['type']} not implemented by handler {mod.name}.")
def startup_messages(self, config, pairlist) -> None:
if config.get('dry_run', False):