Commit eda52d05 by Andy Getzendanner Committed by Copybara-Service

Tweak the signature of status_internal::MakeCheckFailString as part of an upcoming change

PiperOrigin-RevId: 454251164
Change-Id: I256b7a662478f9317a4133ec209fa5488a942886
parent 9431a837
...@@ -15,6 +15,7 @@ ...@@ -15,6 +15,7 @@
#define ABSL_STATUS_INTERNAL_STATUS_INTERNAL_H_ #define ABSL_STATUS_INTERNAL_STATUS_INTERNAL_H_
#include <string> #include <string>
#include <utility>
#include "absl/base/attributes.h" #include "absl/base/attributes.h"
#include "absl/container/inlined_vector.h" #include "absl/container/inlined_vector.h"
...@@ -70,12 +71,11 @@ struct StatusRep { ...@@ -70,12 +71,11 @@ struct StatusRep {
absl::StatusCode MapToLocalCode(int value); absl::StatusCode MapToLocalCode(int value);
// If `status` is not OK, returns a pointer to a newly-allocated string with the // Returns a pointer to a newly-allocated string with the given `prefix`,
// given `prefix`, suitable for output as an error message in assertion/CHECK() // suitable for output as an error message in assertion/`CHECK()` failures.
// failures. Otherwise returns nullptr.
// //
// This is an internal implementation detail for Abseil logging. // This is an internal implementation detail for Abseil logging.
std::string* MakeCheckFailString(const absl::Status& status, std::string* MakeCheckFailString(const absl::Status* status,
const char* prefix); const char* prefix);
} // namespace status_internal } // namespace status_internal
......
...@@ -603,12 +603,11 @@ Status ErrnoToStatus(int error_number, absl::string_view message) { ...@@ -603,12 +603,11 @@ Status ErrnoToStatus(int error_number, absl::string_view message) {
namespace status_internal { namespace status_internal {
std::string* MakeCheckFailString(const absl::Status& status, std::string* MakeCheckFailString(const absl::Status* status,
const char* prefix) { const char* prefix) {
if (status.ok()) { return nullptr; }
return new std::string( return new std::string(
absl::StrCat(prefix, " (", absl::StrCat(prefix, " (",
status.ToString(StatusToStringMode::kWithEverything), ")")); status->ToString(StatusToStringMode::kWithEverything), ")"));
} }
} // namespace status_internal } // namespace status_internal
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment