Skip to content

Commit

Permalink
fix crashdump error(req_result::as when data_ is empty)
Browse files Browse the repository at this point in the history
  • Loading branch information
xie.gang committed Mar 16, 2023
1 parent 431b086 commit faa5c8d
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion include/rest_rpc/rpc_client.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,8 @@ class req_result {

void as() {
if (has_error(data_)) {
throw std::logic_error(get_error_msg(data_));
std::string err_msg = data_.empty() ? data_ : get_error_msg(data_);
throw std::logic_error(err_msg);
}
}

Expand Down

0 comments on commit faa5c8d

Please sign in to comment.