Commit 848e0fa0 authored by Tom Jackson's avatar Tom Jackson Committed by Facebook Github Bot

Guard is broken

Summary: Adding note and disabled test for now, will come back to fixing or killing this later.

Reviewed By: yfeldblum

Differential Revision: D14625209

fbshipit-source-id: 6e4f523c02e28fa6080da16485cba68ee78ffc80
parent d58678d6
......@@ -1748,7 +1748,9 @@ class RangeConcat : public Operator<RangeConcat> {
* | eachTo<int>()
* | as<vector>();
*
* TODO(tjackson): Rename this back to Guard.
* KNOWN ISSUE: This only guards pipelines through operators which do not
* retain resulting values. Exceptions thrown after operators like pmap, order,
* batch, cannot be caught from here.
**/
template <class Exception, class ErrorHandler>
class GuardImpl : public Operator<GuardImpl<Exception, ErrorHandler>> {
......
......@@ -1201,6 +1201,22 @@ TEST(Gen, Guard) {
// clang-format on
}
// Disabled: guard currently can't catch exceptions thrown after a buffering op.
TEST(Gen, DISABLED_GuardThroughBuffers) {
using std::runtime_error;
// clang-format off
EXPECT_EQ(
4,
(from({"1", "a", "3"})
| guard<runtime_error>([](runtime_error&, const char*) {
return true;
})
| batch(1)
| rconcat
| eachTo<int>()
| sum));
// clang-format on
}
TEST(Gen, eachTryTo) {
using std::runtime_error;
// clang-format off
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment