# HG changeset patch # User drewp@bigasterisk.com # Date 1685571926 25200 # Node ID 63f82ec045bf9854e3ffd0c6dd93aa43f3601c6d # Parent b438224512f48dedbcf58d172d87da3012972692 don't stop midi input on a handler error diff -r b438224512f4 -r 63f82ec045bf light9/midifade/midifade.py --- a/light9/midifade/midifade.py Wed May 31 13:51:02 2023 -0700 +++ b/light9/midifade/midifade.py Wed May 31 15:25:26 2023 -0700 @@ -4,6 +4,7 @@ """ import asyncio import logging +import traceback import mido from rdfdb.syncedgraph.syncedgraph import SyncedGraph @@ -57,8 +58,11 @@ recents = [await msgs.get()] while not msgs.empty(): recents.append(msgs.get_nowait()) - - onMessage(graph, ctx, recents[-1]) + try: + onMessage(graph, ctx, recents[-1]) + except Exception as e: + traceback.print_exc() + log.warning("error in onMessage- continuing anyway") await asyncio.sleep(1 / MAX_SEND_RATE) asyncio.create_task(reader())