#245 Add additional catch blocks for GRAPHENE_TRY_NOTIFY
This commit is contained in:
parent
d4c7c97f4c
commit
43fbe98240
1 changed files with 22 additions and 13 deletions
|
|
@ -23,6 +23,7 @@
|
||||||
*/
|
*/
|
||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
|
#include <boost/exception/diagnostic_information.hpp>
|
||||||
#include <fc/exception/exception.hpp>
|
#include <fc/exception/exception.hpp>
|
||||||
#include <graphene/chain/protocol/protocol.hpp>
|
#include <graphene/chain/protocol/protocol.hpp>
|
||||||
|
|
||||||
|
|
@ -65,19 +66,27 @@
|
||||||
msg \
|
msg \
|
||||||
)
|
)
|
||||||
|
|
||||||
#define GRAPHENE_TRY_NOTIFY( signal, ... ) \
|
#define GRAPHENE_TRY_NOTIFY( signal, ... ) \
|
||||||
try \
|
try \
|
||||||
{ \
|
{ \
|
||||||
signal( __VA_ARGS__ ); \
|
signal( __VA_ARGS__ ); \
|
||||||
} \
|
} \
|
||||||
catch( const graphene::chain::plugin_exception& e ) \
|
catch( const graphene::chain::plugin_exception& e ) \
|
||||||
{ \
|
{ \
|
||||||
elog( "Caught plugin exception: ${e}", ("e", e.to_detail_string() ) ); \
|
elog( "Caught plugin exception: ${e}", ("e", e.to_detail_string() ) ); \
|
||||||
throw; \
|
throw; \
|
||||||
} \
|
} \
|
||||||
catch( ... ) \
|
catch( const boost::exception& e ) \
|
||||||
{ \
|
{ \
|
||||||
wlog( "Caught unexpected exception in plugin" ); \
|
elog( "Caught plugin boost::exception: ${e}", ("e", boost::diagnostic_information(e) ) ); \
|
||||||
|
} \
|
||||||
|
catch( const std::exception& e ) \
|
||||||
|
{ \
|
||||||
|
elog( "Caught plugin std::exception: ${e}", ("e", e.what() ) ); \
|
||||||
|
} \
|
||||||
|
catch( ... ) \
|
||||||
|
{ \
|
||||||
|
wlog( "Caught unexpected exception in plugin" ); \
|
||||||
}
|
}
|
||||||
|
|
||||||
namespace graphene { namespace chain {
|
namespace graphene { namespace chain {
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue