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

Function OrElse

cpp/src/arrow/status.h:377–388  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

375 /// If the functor returns void, the original Status is returned.
376 template <typename OnError>
377 Status OrElse(OnError&& on_error) {
378 using RT = decltype(on_error(Status()));
379 if (ARROW_PREDICT_TRUE(ok())) {
380 return *this;
381 }
382 if constexpr (std::is_void_v<RT>) {
383 on_error(*this);
384 return *this;
385 } else {
386 return ToStatus(on_error(*this));
387 }
388 }
389
390 void Warn() const;
391 void Warn(const std::string& message) const;

Callers

nothing calls this directly

Calls 3

okFunction · 0.85
ToStatusFunction · 0.85
StatusClass · 0.50

Tested by

no test coverage detected