diff options
author | Taku Kudo <taku@google.com> | 2018-05-06 18:51:20 +0300 |
---|---|---|
committer | Taku Kudo <taku@google.com> | 2018-05-06 18:51:20 +0300 |
commit | cf0eb82d65850172a4661e47668938ab82cb2c76 (patch) | |
tree | fa6414db5714c6fd15f725d5a9e28cbcb14e20c2 /src/error.cc | |
parent | 31153b117294830ab41ff3e9ee4f0a7323f16d8d (diff) |
CHECK to Status migration for Trainer.
Diffstat (limited to 'src/error.cc')
-rw-r--r-- | src/error.cc | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/src/error.cc b/src/error.cc index b9787b3..93baced 100644 --- a/src/error.cc +++ b/src/error.cc @@ -59,6 +59,11 @@ const char* Status::error_message() const { return ok() ? "" : rep_->error_message.c_str(); } +void Status::set_error_message(const char* str) { + if (rep_ == nullptr) rep_.reset(new Rep); + rep_->error_message = str; +} + error::Code Status::code() const { return ok() ? error::OK : rep_->code; } std::string Status::ToString() const { |