Skip to content

Commit

Permalink
#245 Add additional catch blocks for GRAPHENE_TRY_NOTIFY
Browse files Browse the repository at this point in the history
  • Loading branch information
Vladislav Dobromyslov committed Jan 28, 2022
1 parent d4c7c97 commit 43fbe98
Showing 1 changed file with 22 additions and 13 deletions.
35 changes: 22 additions & 13 deletions libraries/chain/include/graphene/chain/exceptions.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
*/
#pragma once

#include <boost/exception/diagnostic_information.hpp>
#include <fc/exception/exception.hpp>
#include <graphene/chain/protocol/protocol.hpp>

Expand Down Expand Up @@ -65,19 +66,27 @@
msg \
)

#define GRAPHENE_TRY_NOTIFY( signal, ... ) \
try \
{ \
signal( __VA_ARGS__ ); \
} \
catch( const graphene::chain::plugin_exception& e ) \
{ \
elog( "Caught plugin exception: ${e}", ("e", e.to_detail_string() ) ); \
throw; \
} \
catch( ... ) \
{ \
wlog( "Caught unexpected exception in plugin" ); \
#define GRAPHENE_TRY_NOTIFY( signal, ... ) \
try \
{ \
signal( __VA_ARGS__ ); \
} \
catch( const graphene::chain::plugin_exception& e ) \
{ \
elog( "Caught plugin exception: ${e}", ("e", e.to_detail_string() ) ); \
throw; \
} \
catch( const boost::exception& e ) \
{ \
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 {
Expand Down

0 comments on commit 43fbe98

Please sign in to comment.