More fixes in json_connection

This commit is contained in:
Nathan Hourt 2014-10-20 12:52:47 -04:00
parent 891e880ad1
commit c1eca45ef1

View file

@ -74,6 +74,7 @@ namespace fc { namespace rpc {
if( m != obj.end() ) if( m != obj.end() )
{ {
fc::exception except; fc::exception except;
bool exception_caught = false;
try try
{ {
auto p = obj.find("params"); auto p = obj.find("params");
@ -134,17 +135,13 @@ namespace fc { namespace rpc {
} }
catch ( fc::exception& e ) catch ( fc::exception& e )
{ {
if( i != obj.end() ) exception_caught = true;
{ except = e;
except = e;
}
else
{
fc_wlog( _logger, "json rpc exception: ${exception}", ("exception",e) );
}
} }
if( i != obj.end() ) if( exception_caught && i != obj.end() )
send_error( i->value(), except ); send_error( i->value(), except );
else
fc_wlog( _logger, "json rpc exception: ${exception}", ("exception",except) );
} }
else if( i != obj.end() ) //handle any received JSON response else if( i != obj.end() ) //handle any received JSON response
{ {