Merge branch 'phoenix' of https://github.com/InvictusInnovations/fc into phoenix

This commit is contained in:
Daniel Larimer 2014-04-27 21:20:54 -04:00
commit 1d8f80c8f7
2 changed files with 27 additions and 19 deletions

View file

@ -132,6 +132,14 @@ template<> struct reflector<ENUM> { \
}\
return nullptr; \
} \
static const char* to_string(ENUM elem) { \
switch( elem ) { \
BOOST_PP_SEQ_FOR_EACH( FC_REFLECT_ENUM_TO_STRING, ENUM, FIELDS ) \
default: \
fc::throw_bad_enum_cast( BOOST_PP_STRINGIZE(elem), BOOST_PP_STRINGIZE(ENUM) ); \
}\
return nullptr; \
} \
static ENUM from_string( const char* s ) { \
BOOST_PP_SEQ_FOR_EACH( FC_REFLECT_ENUM_FROM_STRING, ENUM, FIELDS ) \
fc::throw_bad_enum_cast( s, BOOST_PP_STRINGIZE(ENUM) ); \

View file

@ -141,7 +141,7 @@ namespace fc { namespace rpc {
}
}
}
else if( i != obj.end() )
else if( i != obj.end() ) //handle any received JSON response
{
uint64_t id = i->value().as_int64();
auto await = _awaiting.find(id);
@ -149,11 +149,11 @@ namespace fc { namespace rpc {
{
auto r = obj.find("result");
auto e = obj.find("error");
if( r != obj.end() )
if( r != obj.end() ) //if regular result response
{
await->second->set_value( r->value() );
}
else if( e != obj.end() )
else if( e != obj.end() ) //if error response
{
try
{