Turning throw expressions into error messages requires catching the exception and then attempting to pass it as a data element.
The framework can only catch known types, and for now it's done in util.h which is too low-level, so it only processes generic std::exception.
The user should be able to specify what exception types might be thrown. Auto detection would be even better, but I don't see how to do that except for stages with only one operator().
Converting catch to pass should perhaps be done in the stage assembly code, not the functor to iterator adaptor.
Comment #1
Posted on May 26, 2013 by Swift HippoImplementation complete and minimally tested. If there is one operator() such as in a lambda, it is used, otherwise a trait is queried.
Still to improve: avoid catching and passing exceptions from downstream. A stage should only pass exceptions generated by itself. This may be hard to reconcile with catching and handling exceptions from downstream. Or it might be easy because it's only a corner case. The handler must be upstream of the thrower or the thrower would have passed it in the first place. So a handler should catch and encapsulate its parameter_exceptions.
Status: Fixed
Labels:
Type-Enhancement
Priority-Medium