Skip to content

Commit

Permalink
Catch NotImplementedError when sending messages
Browse files Browse the repository at this point in the history
(RPC should not crash your bot!)
  • Loading branch information
xmatthias committed Aug 30, 2019
1 parent b6b7dcd commit d977695
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion freqtrade/rpc/rpc_manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,10 @@ def send_msg(self, msg: Dict[str, Any]) -> None:
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):
Expand Down

0 comments on commit d977695

Please sign in to comment.