|
| GuardImpl (ErrorHandler handler) |
|
template<class Value , class Source , class Gen = Generator<Value, Source>> |
Gen | compose (GenImpl< Value, Source > &&source) const |
|
template<class Value , class Source , class Gen = Generator<Value, Source>> |
Gen | compose (const GenImpl< Value, Source > &source) const |
|
ResultGen | compose (const GenImpl< Value, Source > &source) const |
|
const Self & | self () const |
|
Self & | self () |
|
template<class Exception, class ErrorHandler>
class folly::gen::detail::GuardImpl< Exception, ErrorHandler >
GuardImpl - For handling exceptions from downstream computation. Requires the type of exception to catch, and handler function to invoke in the event of the exception. Note that the handler may: 1) return true to continue processing the sequence 2) return false to end the sequence immediately 3) throw, to pass the exception to the next catch The handler must match the signature 'bool(Exception&, Value)'.
This type is used through the guard
helper, like so:
auto indexes = byLine(STDIN_FILENO) | guard<std::runtime_error>([](std::runtime_error& e, StringPiece sp) { LOG(ERROR) << sp << ": " << e.str(); return true; // continue processing subsequent lines }) | eachTo<int>() | as<vector>();
TODO(tjackson): Rename this back to Guard.
Definition at line 1754 of file Base-inl.h.