Skip to content

Commit

Permalink
Merge pull request #94 from lemon19900815/master
Browse files Browse the repository at this point in the history
fix crashdump error(req_result::as when data_ is empty)
  • Loading branch information
qicosmos authored Mar 16, 2023
2 parents 431b086 + faa5c8d commit 68e7bc1
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 68e7bc1

Please sign in to comment.