| 44 | } |
| 45 | |
| 46 | Status StatusFromProto(const StatusPB& status) { |
| 47 | if (status.status_code() == TErrorCode::OK) return Status::OK(); |
| 48 | |
| 49 | ErrorMsg msg; |
| 50 | msg.SetErrorCode(static_cast<TErrorCode::type>(status.status_code())); |
| 51 | if (status.error_msgs().size() > 0) { |
| 52 | // The first message is the actual error message. (See StatusToThrift()). |
| 53 | msg.SetErrorMsg(status.error_msgs().Get(0)); |
| 54 | // The following messages are details. |
| 55 | std::for_each(status.error_msgs().begin() + 1, status.error_msgs().end(), |
| 56 | [&](string const& detail) { msg.AddDetail(detail); }); |
| 57 | } |
| 58 | return Status(msg); |
| 59 | } |
| 60 | |
| 61 | Status StatusFromHS2Status( |
| 62 | const apache::hive::service::cli::thrift::TStatus& hs2_status) { |
no test coverage detected