Error initializing asio buffers5/5/2023 You can retrive the error_code from the system_error by calling code() member function: catch(boost::system::system_error const& e)īoost::system::error_code error = e.code() Exception approach tryĬatch(boost::system::system_error const& e) To return an error by reference, an instance of boost::system::error_code is used. When Boost.Asio function throws an exception, it throws an instance of boost::system::system_error which is inherited from the std::runtime_error exception class. Every synchronous I/O function in Boost.Asio has two overloads in order to deal with errors: the first one throws an exception, and the second one returns an error by reference (return value approach).
0 Comments
Leave a Reply.AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |