Skip to content

Commit

Permalink
Rethrow asio operation cancellation exception ...
Browse files Browse the repository at this point in the history
... `boost::asio::error::operation_aborted` as `fc::canceled_exception`
instead of `fc::exception`
  • Loading branch information
abitmore committed Sep 4, 2023
1 parent 2405393 commit c38d044
Showing 1 changed file with 12 additions and 4 deletions.
16 changes: 12 additions & 4 deletions src/asio.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -53,13 +53,21 @@ namespace fc {
{
if( ec == boost::asio::error::eof )
{
p->set_exception( fc::exception_ptr( new fc::eof_exception(
FC_LOG_MESSAGE( error, "${message} ", ("message", boost::system::system_error(ec).what())) ) ) );
p->set_exception( std::make_shared<fc::eof_exception>(
FC_LOG_MESSAGE( error, "${message} ",
("message", boost::system::system_error(ec).what())) ) );
}
else if( ec == boost::asio::error::operation_aborted )
{
p->set_exception( std::make_shared<fc::canceled_exception>(
FC_LOG_MESSAGE( error, "${message} ",
("message", boost::system::system_error(ec).what())) ) );
}
else
{
p->set_exception( fc::exception_ptr( new fc::exception(
FC_LOG_MESSAGE( error, "${message} ", ("message", boost::system::system_error(ec).what())) ) ) );
p->set_exception( std::make_shared<fc::exception>(
FC_LOG_MESSAGE( error, "${message} ",
("message", boost::system::system_error(ec).what())) ) );
}
}
}
Expand Down

0 comments on commit c38d044

Please sign in to comment.