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

Function MakeFailingGenerator

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

Source from the content-addressed store, hash-verified

2074/// This generator is async-reentrant.
2075template <typename T>
2076AsyncGenerator<T> MakeFailingGenerator(Status st) {
2077 assert(!st.ok());
2078 auto state = std::make_shared<Status>(std::move(st));
2079 return [state]() -> Future<T> {
2080 auto st = std::move(*state);
2081 if (!st.ok()) {
2082 return st;
2083 } else {
2084 return AsyncGeneratorEnd<T>();
2085 }
2086 };
2087}
2088
2089/// \brief Make a generator that always fails with a given error
2090///

Callers 1

GetFileInfoGeneratorMethod · 0.85

Calls 2

okMethod · 0.45
statusMethod · 0.45

Tested by

no test coverage detected