Boost logo

Boost Users :

Subject: Re: [Boost-users] exception type thrown by ip::address::from_string()
From: Igor R (boost.lists_at_[hidden])
Date: 2010-10-21 17:05:33


> I've started working with the Boost ASIO library and came across a problem.
> I'm trying to catch exceptions thrown
> by boost::asio::ip::address::from_string(const std::string & str) but I
> don't know what the type of the exception that I should catch is. I can find
> no mention of this in the boost reference. Any help would be appreciated.

As you can see, this function also has overloads that take
boost::system::error_code by reference:
http://www.boost.org/doc/libs/1_44_0/doc/html/boost_asio/reference/ip__address/from_string.html

Generally, if a function in asio has overloads with and without such a
parameter, the former "returns" an error in the parameter, and the
latter throws boost::system::system_error instead.
For most functions it's mentioned explicitly, like here:
http://www.boost.org/doc/libs/1_44_0/doc/html/boost_asio/reference/basic_stream_socket/connect/overload1.html

But from_string() reference really lacks this point for some reason.


Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net