Skip to content

Commit

Permalink
improve sgx related logs; #841
Browse files Browse the repository at this point in the history
  • Loading branch information
PropzSaladaz committed Feb 5, 2025
1 parent 180fe72 commit 6bedb01
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 2 deletions.
7 changes: 6 additions & 1 deletion catchup/client/CatchupClientAgent.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -269,10 +269,15 @@ ptr< CommittedBlockList > CatchupClientAgent::readMissingBlocks( ptr< ClientSock


if ( blockSizes->size() > 1 ) {
LOG( info, "CATCHUP_GOT_BLOCKS:COUNT:"
if ( blockList->getBlocks()->size() > 1) {
LOG( info, "CATCHUP_GOT_BLOCKS:COUNT:"
<< to_string( blockSizes->size() ) << ":STARTBLOCK:"
<< string( blockList->getBlocks()->at( 0 )->getBlockID() )
<< ":FROM_NODE:" << _socket->getIP() );
}
else {
LOG( err, "Could not deserialize blocks" );
}
}
} catch ( ExitRequestedException& ) {
throw;
Expand Down
2 changes: 1 addition & 1 deletion json/JSONFactory.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -570,7 +570,7 @@ void JSONFactory::checkSGXStatus( Json::Value& _result ) {

if ( status != 0 ) {
LOG( err, "SGX server returned error status:" << to_string( status ) );
LOG( err, _result.asString() );
LOG( err, _result["errorMessage"].asString() );
}

CHECK_STATE( status == 0 );
Expand Down
5 changes: 5 additions & 0 deletions sgxclient/SgxZmqMessage.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,11 @@ shared_ptr< SgxZmqMessage > SgxZmqMessage::parse(

CHECK_STATE( ( *d )["status"].IsNumber() )
uint64_t status = ( *d )["status"].GetInt64();

if ( status != 0 ) {
LOG( err, ( *d )["errorMessage"].GetString() );
}

CHECK_STATE( status == 0 );

CHECK_STATE( d->HasMember( "type" ) );
Expand Down

0 comments on commit 6bedb01

Please sign in to comment.