| 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; |