Mercurial > code > home > repos > light9
changeset 2314:63f82ec045bf
don't stop midi input on a handler error
author | drewp@bigasterisk.com |
---|---|
date | Wed, 31 May 2023 15:25:26 -0700 |
parents | b438224512f4 |
children | 635568de3c9a |
files | light9/midifade/midifade.py |
diffstat | 1 files changed, 6 insertions(+), 2 deletions(-) [+] |
line wrap: on
line diff
--- 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())