Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/marian-nmt/sentencepiece.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTaku Kudo <taku@google.com>2018-05-06 18:51:20 +0300
committerTaku Kudo <taku@google.com>2018-05-06 18:51:20 +0300
commitcf0eb82d65850172a4661e47668938ab82cb2c76 (patch)
treefa6414db5714c6fd15f725d5a9e28cbcb14e20c2 /src/error.cc
parent31153b117294830ab41ff3e9ee4f0a7323f16d8d (diff)
CHECK to Status migration for Trainer.
Diffstat (limited to 'src/error.cc')
-rw-r--r--src/error.cc5
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 {