blob: 887c5bd29fa927ce8923fcbc36e4f817becf5a42 [file] [log] [blame]
// Copyright 2020 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#include "chrome/browser/policy/messaging_layer/util/statusor.h"
#include "base/no_destructor.h"
namespace reporting {
namespace internal {
// static
const Status& StatusOrHelper::NotInitializedStatus() {
static base::NoDestructor<Status> status_not_initialized(error::UNKNOWN,
"Not initialized");
return *status_not_initialized;
}
// static
const Status& StatusOrHelper::MovedOutStatus() {
static base::NoDestructor<Status> status_moved_out(error::UNKNOWN,
"Value moved out");
return *status_moved_out;
}
// static
void StatusOrHelper::Crash(const Status& status) {
LOG(FATAL) << "Attempting to fetch value instead of handling error "
<< status.ToString();
}
} // namespace internal
} // namespace reporting