You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This is a failing of the example code. We put some exception handling in the dispatcher, so if an function passed to on_update fails we get the traceback printed, but we don't do anything with the long running update function in the example. We can make use of the same exception handling by scheduling it with the dispatcher:
...
# Start processes required to be run after iocInitasyncdefupdate():
whileTrue:
ai.set(ai.get() +1)
awaitasyncio.sleep(1)
raiseException("Boom")
dispatcher(update)
# Finally leave the IOC running with an interactive shell.softioc.interactive_ioc(globals())
This now prints
Starting iocInit
############################################################################
## EPICS 7.0.6.1
## Rev. 7.0.6.99.2.0
############################################################################
iocRun: All initialization complete
Python 3.7.2 (default, Jan 20 2020, 11:03:41)
[GCC 4.8.5 20150623 (Red Hat 4.8.5-39)] on linux
Type "help", "copyright", "credits" or "license" for more information.
(InteractiveConsole)
>>> ERROR:root:Exception when awaiting callback
Traceback (most recent call last):
File "/dls/science/users/tmc43/common/python/pythonSoftIOC/softioc/asyncio_dispatcher.py", line 35, in async_wrapper
await ret
File "example_asyncio_ioc.py", line 26, in update
raise Exception("Boom")
Exception: Boom
The logging message isn't the best though, I'll make an issue to track this
This is a failing of the example code. We put some exception handling in the dispatcher, so if an function passed to
on_update
fails we get the traceback printed, but we don't do anything with the long runningupdate
function in the example. We can make use of the same exception handling by scheduling it with the dispatcher:This now prints
The logging message isn't the best though, I'll make an issue to track this
Originally posted by @coretl in #93 (reply in thread)
The text was updated successfully, but these errors were encountered: