mpi-sws-rse / thingflow-python

Streaming dataflow library for IoT applications. Program at a higher level, with reusable "things".
Apache License 2.0
35 stars 10 forks source link

Need a way to capture non-fatal errors and potentially make them fatal #3

Open jfischer opened 7 years ago

jfischer commented 7 years ago

Borrowing from RxPython, ThingFlow provides an on_error() interface for input things and filters. If a non-fatal error occurs, the associated thing should catch the error, print it out, pass it downstream using _dispatch_error() and then close the downstream connections. See IterableAsOutputThing for an example.

The problem with this approach is that errors just end up on standard output and operation continues (assuming there still is something to run). Ideally, we'd want to have a standard error handler for non-fatal errors (that just prints it as default) and some way of making non-fatal errors fatal. This is challenging, since the "things" don't have any access to the scheduler's state (the natural place to put this error handler).