blob: aeee0f502257cfee99735e00a03992f6985d539c (
plain) (
tree)
|
|
#pragma once
#include <absl/status/status.h>
#include <absl/strings/str_format.h>
#include <absl/strings/string_view.h>
#include "libutil/types.hh"
namespace nix::util {
inline void OkOrThrow(absl::Status status) {
if (!status.ok()) {
throw Error(absl::StrFormat("Operation failed: %s", status.ToString()));
}
}
} // namespace nix::util
|