Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
qicosmos committed Mar 22, 2019
1 parent fa0503f commit 70d7627
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions include/client_util.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,15 @@

namespace rest_rpc {
inline bool has_error(std::string_view result) {
msgpack_codec codec;
rpc_service::msgpack_codec codec;
auto tp = codec.unpack<std::tuple<int>>(result.data(), result.size());

return std::get<0>(tp) != 0;
}

template<typename T>
inline T get_result(std::string_view result) {
msgpack_codec codec;
rpc_service::msgpack_codec codec;
auto tp = codec.unpack<std::tuple<int>>(result.data(), result.size());
if (std::get<0>(tp) != 0)
throw std::logic_error("rpc error");
Expand Down

0 comments on commit 70d7627

Please sign in to comment.