Skip to content

Commit

Permalink
GH-529 Add better logging for errors during apply_block
Browse files Browse the repository at this point in the history
  • Loading branch information
heifner committed Sep 2, 2024
1 parent 7b0d55d commit a30d059
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions libraries/chain/controller.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4224,9 +4224,8 @@ struct controller_impl {

for( auto ritr = branches.first.rbegin(); ritr != branches.first.rend(); ++ritr ) {
auto except = std::exception_ptr{};
const auto& bsp = *ritr;
try {
const auto& bsp = *ritr;

bool applied = apply_block( bsp, bsp->is_valid() ? controller::block_status::validated
: controller::block_status::complete, trx_lookup );
if (!switch_fork && (!applied || check_shutdown())) {
Expand All @@ -4238,7 +4237,8 @@ struct controller_impl {
} catch ( const boost::interprocess::bad_alloc& ) {
throw;
} catch (const fc::exception& e) {
elog("exception thrown while switching forks ${e}", ("e", e.to_detail_string()));
elog("exception thrown while applying block ${bn} : ${id}, previous ${p}, error: ${e}",
("bn", bsp->block_num())("id", bsp->id())("p", bsp->previous())("e", e.to_detail_string()));
except = std::current_exception();
} catch (const std::exception& e) {
elog("exception thrown while switching forks ${e}", ("e", e.what()));
Expand Down

0 comments on commit a30d059

Please sign in to comment.