You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
fc::exception has support for dynamic_rethrow_exception which is documented as:
/**
* Rethrows the exception restoring the proper type based upon
* the error code. This is used to propagate exception types
* across conversions to/from JSON
*/
// this always throws an fc::exception, since the original exception is copied into an fc::exception
trace->except->dynamic_rethrow_exception();
Changing action_trace and transaction_trace to use an fc::exception_ptr is an API breaking change.
Changing fc::exception to have an error_code is also an API breaking change. Since this is an addition, maybe this would cause no harm. Not sure if that affects consensus.
The text was updated successfully, but these errors were encountered:
fc::exception
has support fordynamic_rethrow_exception
which is documented as:We use this in a few places:
spring/plugins/http_plugin/include/eosio/http_plugin/macros.hpp
Line 16 in 8169da9
spring/libraries/chain/snapshot_scheduler.cpp
Line 136 in 8169da9
This requires:
spring/libraries/libfc/src/exception.cpp
Lines 10 to 28 in 8169da9
Which we do NOT do for any of the chain exceptions in:
spring/libraries/chain/include/eosio/chain/exceptions.hpp
Line 185 in 8169da9
Note we add an
error_code
tochain_exception
which all chain exceptions derive from. This is used here:spring/libraries/chain/controller.cpp
Lines 5858 to 5866 in 8169da9
But even if we did register them, they would slice off the
error_code
on rethrow:spring/libraries/libfc/include/fc/exception/exception.hpp
Lines 221 to 224 in 8169da9
When exceptions are placed
action_trace
andtransaction_trace
they are sliced to afc::exception
losing thiserror_code
:spring/libraries/chain/include/eosio/chain/trace.hpp
Line 45 in 8169da9
When an exception is placed in the
action_trace
ortransaction_trace
and is rethrown, it is always rethrown as afc::exception
. As commented here:spring/libraries/testing/tester.cpp
Lines 485 to 486 in 8169da9
Changing
action_trace
andtransaction_trace
to use anfc::exception_ptr
is an API breaking change.Changing
fc::exception
to have anerror_code
is also an API breaking change. Since this is an addition, maybe this would cause no harm. Not sure if that affects consensus.The text was updated successfully, but these errors were encountered: