MCPcopy Create free account
hub / github.com/apache/arrow / MakeFailingGenerator

Function MakeFailingGenerator

cpp/src/arrow/util/async_generator.h:1971–1982  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1969/// This generator is async-reentrant.
1970template <typename T>
1971AsyncGenerator<T> MakeFailingGenerator(Status st) {
1972 assert(!st.ok());
1973 auto state = std::make_shared<Status>(std::move(st));
1974 return [state]() -> Future<T> {
1975 auto st = std::move(*state);
1976 if (!st.ok()) {
1977 return st;
1978 } else {
1979 return AsyncGeneratorEnd<T>();
1980 }
1981 };
1982}
1983
1984/// \brief Make a generator that always fails with a given error
1985///

Callers 1

GetFileInfoGeneratorMethod · 0.85

Calls 2

okMethod · 0.45
statusMethod · 0.45

Tested by

no test coverage detected