| 33 | } |
| 34 | |
| 35 | void CatchRegistryError(const std::function<Maybe<void>()>& handler) { |
| 36 | const auto& maybe_error = TRY(handler()); |
| 37 | if (!maybe_error.IsOk()) { |
| 38 | if (!*MutRegistryError()) { *MutRegistryError() = maybe_error.stacked_error(); } |
| 39 | } |
| 40 | } |
| 41 | |
| 42 | } // namespace oneflow |
no test coverage detected