| 69 | } |
| 70 | |
| 71 | void StatusToThrift(const Status& status, TStatus* thrift_status) { |
| 72 | thrift_status->error_msgs.clear(); |
| 73 | if (status.ok()) { |
| 74 | thrift_status->status_code = TErrorCode::OK; |
| 75 | } else { |
| 76 | thrift_status->status_code = status.code(); |
| 77 | thrift_status->error_msgs.push_back(status.msg().msg()); |
| 78 | for (const string& s: status.msg().details()) { |
| 79 | thrift_status->error_msgs.push_back(s); |
| 80 | } |
| 81 | thrift_status->__isset.error_msgs = true; |
| 82 | } |
| 83 | } |
| 84 | |
| 85 | void StatusToProto(const Status& status, StatusPB* proto_status) { |
| 86 | proto_status->Clear(); |