Skip to content

Commit

Permalink
Fix ucaught exception in RpcDriver::onRpcFrameReceived()
Browse files Browse the repository at this point in the history
  • Loading branch information
Fanda Vacek committed Oct 23, 2024
1 parent 52b8c27 commit 30609c7
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions libshvchainpack/src/rpcdriver.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -92,8 +92,14 @@ void RpcDriver::setDefaultRpcTimeoutMsec(int msec)

void RpcDriver::onRpcFrameReceived(RpcFrame &&frame)
{
auto msg = frame.toRpcMessage();
onRpcMessageReceived(msg);
std::string errmsg;
auto msg = frame.toRpcMessage(&errmsg);
if (errmsg.empty()) {
onRpcMessageReceived(msg);
}
else {
logRpcDataW() << "ERROR - Rpc frame data corrupted:" << errmsg;
}
}

std::string RpcDriver::frameToPrettyCpon(const RpcFrame &frame)
Expand Down

0 comments on commit 30609c7

Please sign in to comment.