Include function name in exception what() messages.

This commit is contained in:
Christopher Kohlhoff 2011-02-27 16:39:37 +11:00
parent 1d8b071714
commit e6122c628f
23 changed files with 141 additions and 141 deletions

View File

@ -158,7 +158,7 @@ public:
{
asio::error_code ec;
std::size_t s = this->service.send(this->implementation, buffers, 0, ec);
asio::detail::throw_error(ec);
asio::detail::throw_error(ec, "send");
return s;
}
@ -186,7 +186,7 @@ public:
asio::error_code ec;
std::size_t s = this->service.send(
this->implementation, buffers, flags, ec);
asio::detail::throw_error(ec);
asio::detail::throw_error(ec, "send");
return s;
}
@ -334,7 +334,7 @@ public:
asio::error_code ec;
std::size_t s = this->service.send_to(
this->implementation, buffers, destination, 0, ec);
asio::detail::throw_error(ec);
asio::detail::throw_error(ec, "send_to");
return s;
}
@ -361,7 +361,7 @@ public:
asio::error_code ec;
std::size_t s = this->service.send_to(
this->implementation, buffers, destination, flags, ec);
asio::detail::throw_error(ec);
asio::detail::throw_error(ec, "send_to");
return s;
}
@ -509,7 +509,7 @@ public:
asio::error_code ec;
std::size_t s = this->service.receive(
this->implementation, buffers, 0, ec);
asio::detail::throw_error(ec);
asio::detail::throw_error(ec, "receive");
return s;
}
@ -538,7 +538,7 @@ public:
asio::error_code ec;
std::size_t s = this->service.receive(
this->implementation, buffers, flags, ec);
asio::detail::throw_error(ec);
asio::detail::throw_error(ec, "receive");
return s;
}
@ -687,7 +687,7 @@ public:
asio::error_code ec;
std::size_t s = this->service.receive_from(
this->implementation, buffers, sender_endpoint, 0, ec);
asio::detail::throw_error(ec);
asio::detail::throw_error(ec, "receive_from");
return s;
}
@ -714,7 +714,7 @@ public:
asio::error_code ec;
std::size_t s = this->service.receive_from(
this->implementation, buffers, sender_endpoint, flags, ec);
asio::detail::throw_error(ec);
asio::detail::throw_error(ec, "receive_from");
return s;
}

View File

@ -161,7 +161,7 @@ public:
{
asio::error_code ec;
this->service.expires_at(this->implementation, expiry_time, ec);
asio::detail::throw_error(ec);
asio::detail::throw_error(ec, "expires_at");
}
/// Constructor to set a particular expiry time relative to now.
@ -180,7 +180,7 @@ public:
{
asio::error_code ec;
this->service.expires_from_now(this->implementation, expiry_time, ec);
asio::detail::throw_error(ec);
asio::detail::throw_error(ec, "expires_from_now");
}
/// Cancel any asynchronous operations that are waiting on the timer.
@ -209,7 +209,7 @@ public:
{
asio::error_code ec;
std::size_t s = this->service.cancel(this->implementation, ec);
asio::detail::throw_error(ec);
asio::detail::throw_error(ec, "cancel");
return s;
}
@ -268,7 +268,7 @@ public:
{
asio::error_code ec;
std::size_t s = this->service.cancel_one(this->implementation, ec);
asio::detail::throw_error(ec);
asio::detail::throw_error(ec, "cancel_one");
return s;
}
@ -338,7 +338,7 @@ public:
asio::error_code ec;
std::size_t s = this->service.expires_at(
this->implementation, expiry_time, ec);
asio::detail::throw_error(ec);
asio::detail::throw_error(ec, "expires_at");
return s;
}
@ -407,7 +407,7 @@ public:
asio::error_code ec;
std::size_t s = this->service.expires_from_now(
this->implementation, expiry_time, ec);
asio::detail::throw_error(ec);
asio::detail::throw_error(ec, "expires_from_now");
return s;
}
@ -451,7 +451,7 @@ public:
{
asio::error_code ec;
this->service.wait(this->implementation, ec);
asio::detail::throw_error(ec);
asio::detail::throw_error(ec, "wait");
}
/// Perform a blocking wait on the timer.

View File

@ -157,7 +157,7 @@ public:
{
asio::error_code ec;
std::size_t s = this->service.send(this->implementation, buffers, 0, ec);
asio::detail::throw_error(ec);
asio::detail::throw_error(ec, "send");
return s;
}
@ -184,7 +184,7 @@ public:
asio::error_code ec;
std::size_t s = this->service.send(
this->implementation, buffers, flags, ec);
asio::detail::throw_error(ec);
asio::detail::throw_error(ec, "send");
return s;
}
@ -329,7 +329,7 @@ public:
asio::error_code ec;
std::size_t s = this->service.send_to(
this->implementation, buffers, destination, 0, ec);
asio::detail::throw_error(ec);
asio::detail::throw_error(ec, "send_to");
return s;
}
@ -356,7 +356,7 @@ public:
asio::error_code ec;
std::size_t s = this->service.send_to(
this->implementation, buffers, destination, flags, ec);
asio::detail::throw_error(ec);
asio::detail::throw_error(ec, "send_to");
return s;
}
@ -504,7 +504,7 @@ public:
asio::error_code ec;
std::size_t s = this->service.receive(
this->implementation, buffers, 0, ec);
asio::detail::throw_error(ec);
asio::detail::throw_error(ec, "receive");
return s;
}
@ -533,7 +533,7 @@ public:
asio::error_code ec;
std::size_t s = this->service.receive(
this->implementation, buffers, flags, ec);
asio::detail::throw_error(ec);
asio::detail::throw_error(ec, "receive");
return s;
}
@ -682,7 +682,7 @@ public:
asio::error_code ec;
std::size_t s = this->service.receive_from(
this->implementation, buffers, sender_endpoint, 0, ec);
asio::detail::throw_error(ec);
asio::detail::throw_error(ec, "receive_from");
return s;
}
@ -709,7 +709,7 @@ public:
asio::error_code ec;
std::size_t s = this->service.receive_from(
this->implementation, buffers, sender_endpoint, flags, ec);
asio::detail::throw_error(ec);
asio::detail::throw_error(ec, "receive_from");
return s;
}

View File

@ -165,7 +165,7 @@ public:
asio::error_code ec;
std::size_t s = this->service.send(
this->implementation, buffers, flags, ec);
asio::detail::throw_error(ec);
asio::detail::throw_error(ec, "send");
return s;
}
@ -275,7 +275,7 @@ public:
asio::error_code ec;
std::size_t s = this->service.receive(
this->implementation, buffers, 0, out_flags, ec);
asio::detail::throw_error(ec);
asio::detail::throw_error(ec, "receive");
return s;
}
@ -322,7 +322,7 @@ public:
asio::error_code ec;
std::size_t s = this->service.receive(
this->implementation, buffers, in_flags, out_flags, ec);
asio::detail::throw_error(ec);
asio::detail::throw_error(ec, "receive");
return s;
}

View File

@ -87,7 +87,7 @@ public:
{
asio::error_code ec;
this->service.open(this->implementation, device, ec);
asio::detail::throw_error(ec);
asio::detail::throw_error(ec, "open");
}
/// Construct and open a basic_serial_port.
@ -107,7 +107,7 @@ public:
{
asio::error_code ec;
this->service.open(this->implementation, device, ec);
asio::detail::throw_error(ec);
asio::detail::throw_error(ec, "open");
}
/// Construct a basic_serial_port on an existing native serial port.
@ -128,7 +128,7 @@ public:
{
asio::error_code ec;
this->service.assign(this->implementation, native_serial_port, ec);
asio::detail::throw_error(ec);
asio::detail::throw_error(ec, "assign");
}
/// Get a reference to the lowest layer.
@ -171,7 +171,7 @@ public:
{
asio::error_code ec;
this->service.open(this->implementation, device, ec);
asio::detail::throw_error(ec);
asio::detail::throw_error(ec, "open");
}
/// Open the serial port using the specified device name.
@ -201,7 +201,7 @@ public:
{
asio::error_code ec;
this->service.assign(this->implementation, native_serial_port, ec);
asio::detail::throw_error(ec);
asio::detail::throw_error(ec, "assign");
}
/// Assign an existing native serial port to the serial port.
@ -236,7 +236,7 @@ public:
{
asio::error_code ec;
this->service.close(this->implementation, ec);
asio::detail::throw_error(ec);
asio::detail::throw_error(ec, "close");
}
/// Close the serial port.
@ -287,7 +287,7 @@ public:
{
asio::error_code ec;
this->service.cancel(this->implementation, ec);
asio::detail::throw_error(ec);
asio::detail::throw_error(ec, "cancel");
}
/// Cancel all asynchronous operations associated with the serial port.
@ -314,7 +314,7 @@ public:
{
asio::error_code ec;
this->service.send_break(this->implementation, ec);
asio::detail::throw_error(ec);
asio::detail::throw_error(ec, "send_break");
}
/// Send a break sequence to the serial port.
@ -349,7 +349,7 @@ public:
{
asio::error_code ec;
this->service.set_option(this->implementation, option, ec);
asio::detail::throw_error(ec);
asio::detail::throw_error(ec, "set_option");
}
/// Set an option on the serial port.
@ -395,7 +395,7 @@ public:
{
asio::error_code ec;
this->service.get_option(this->implementation, option, ec);
asio::detail::throw_error(ec);
asio::detail::throw_error(ec, "get_option");
}
/// Get an option from the serial port.
@ -453,7 +453,7 @@ public:
{
asio::error_code ec;
std::size_t s = this->service.write_some(this->implementation, buffers, ec);
asio::detail::throw_error(ec);
asio::detail::throw_error(ec, "write_some");
return s;
}
@ -560,7 +560,7 @@ public:
{
asio::error_code ec;
std::size_t s = this->service.read_some(this->implementation, buffers, ec);
asio::detail::throw_error(ec);
asio::detail::throw_error(ec, "read_some");
return s;
}

View File

@ -124,7 +124,7 @@ public:
{
asio::error_code ec;
this->service.add(this->implementation, signal_number_1, ec);
asio::detail::throw_error(ec);
asio::detail::throw_error(ec, "add");
}
/// Construct a signal set and add two signals.
@ -149,9 +149,9 @@ public:
{
asio::error_code ec;
this->service.add(this->implementation, signal_number_1, ec);
asio::detail::throw_error(ec);
asio::detail::throw_error(ec, "add");
this->service.add(this->implementation, signal_number_2, ec);
asio::detail::throw_error(ec);
asio::detail::throw_error(ec, "add");
}
/// Construct a signal set and add three signals.
@ -179,11 +179,11 @@ public:
{
asio::error_code ec;
this->service.add(this->implementation, signal_number_1, ec);
asio::detail::throw_error(ec);
asio::detail::throw_error(ec, "add");
this->service.add(this->implementation, signal_number_2, ec);
asio::detail::throw_error(ec);
asio::detail::throw_error(ec, "add");
this->service.add(this->implementation, signal_number_3, ec);
asio::detail::throw_error(ec);
asio::detail::throw_error(ec, "add");
}
/// Add a signal to a signal_set.
@ -199,7 +199,7 @@ public:
{
asio::error_code ec;
this->service.add(this->implementation, signal_number, ec);
asio::detail::throw_error(ec);
asio::detail::throw_error(ec, "add");
}
/// Add a signal to a signal_set.
@ -233,7 +233,7 @@ public:
{
asio::error_code ec;
this->service.remove(this->implementation, signal_number, ec);
asio::detail::throw_error(ec);
asio::detail::throw_error(ec, "remove");
}
/// Remove a signal from a signal_set.
@ -267,7 +267,7 @@ public:
{
asio::error_code ec;
this->service.clear(this->implementation, ec);
asio::detail::throw_error(ec);
asio::detail::throw_error(ec, "clear");
}
/// Remove all signals from a signal_set.
@ -309,7 +309,7 @@ public:
{
asio::error_code ec;
this->service.cancel(this->implementation, ec);
asio::detail::throw_error(ec);
asio::detail::throw_error(ec, "cancel");
}
/// Cancel all operations associated with the signal set.

View File

@ -86,7 +86,7 @@ public:
{
asio::error_code ec;
this->service.open(this->implementation, protocol, ec);
asio::detail::throw_error(ec);
asio::detail::throw_error(ec, "open");
}
/// Construct a basic_socket, opening it and binding it to the given local
@ -110,9 +110,9 @@ public:
{
asio::error_code ec;
this->service.open(this->implementation, endpoint.protocol(), ec);
asio::detail::throw_error(ec);
asio::detail::throw_error(ec, "open");
this->service.bind(this->implementation, endpoint, ec);
asio::detail::throw_error(ec);
asio::detail::throw_error(ec, "bind");
}
/// Construct a basic_socket on an existing native socket.
@ -134,7 +134,7 @@ public:
{
asio::error_code ec;
this->service.assign(this->implementation, protocol, native_socket, ec);
asio::detail::throw_error(ec);
asio::detail::throw_error(ec, "assign");
}
/// Get a reference to the lowest layer.
@ -183,7 +183,7 @@ public:
{
asio::error_code ec;
this->service.open(this->implementation, protocol, ec);
asio::detail::throw_error(ec);
asio::detail::throw_error(ec, "open");
}
/// Open the socket using the specified protocol.
@ -226,7 +226,7 @@ public:
{
asio::error_code ec;
this->service.assign(this->implementation, protocol, native_socket, ec);
asio::detail::throw_error(ec);
asio::detail::throw_error(ec, "assign");
}
/// Assign an existing native socket to the socket.
@ -267,7 +267,7 @@ public:
{
asio::error_code ec;
this->service.close(this->implementation, ec);
asio::detail::throw_error(ec);
asio::detail::throw_error(ec, "close");
}
/// Close the socket.
@ -365,7 +365,7 @@ public:
{
asio::error_code ec;
this->service.cancel(this->implementation, ec);
asio::detail::throw_error(ec);
asio::detail::throw_error(ec, "cancel");
}
/// Cancel all asynchronous operations associated with the socket.
@ -428,7 +428,7 @@ public:
{
asio::error_code ec;
bool b = this->service.at_mark(this->implementation, ec);
asio::detail::throw_error(ec);
asio::detail::throw_error(ec, "at_mark");
return b;
}
@ -461,7 +461,7 @@ public:
{
asio::error_code ec;
std::size_t s = this->service.available(this->implementation, ec);
asio::detail::throw_error(ec);
asio::detail::throw_error(ec, "available");
return s;
}
@ -502,7 +502,7 @@ public:
{
asio::error_code ec;
this->service.bind(this->implementation, endpoint, ec);
asio::detail::throw_error(ec);
asio::detail::throw_error(ec, "bind");
}
/// Bind the socket to the given local endpoint.
@ -563,10 +563,10 @@ public:
if (!is_open())
{
this->service.open(this->implementation, peer_endpoint.protocol(), ec);
asio::detail::throw_error(ec);
asio::detail::throw_error(ec, "connect");
}
this->service.connect(this->implementation, peer_endpoint, ec);
asio::detail::throw_error(ec);
asio::detail::throw_error(ec, "connect");
}
/// Connect the socket to the specified endpoint.
@ -715,7 +715,7 @@ public:
{
asio::error_code ec;
this->service.set_option(this->implementation, option, ec);
asio::detail::throw_error(ec);
asio::detail::throw_error(ec, "set_option");
}
/// Set an option on the socket.
@ -804,7 +804,7 @@ public:
{
asio::error_code ec;
this->service.get_option(this->implementation, option, ec);
asio::detail::throw_error(ec);
asio::detail::throw_error(ec, "get_option");
}
/// Get an option from the socket.
@ -881,7 +881,7 @@ public:
{
asio::error_code ec;
this->service.io_control(this->implementation, command, ec);
asio::detail::throw_error(ec);
asio::detail::throw_error(ec, "io_control");
}
/// Perform an IO control command on the socket.
@ -951,7 +951,7 @@ public:
{
asio::error_code ec;
this->service.non_blocking(this->implementation, mode, ec);
asio::detail::throw_error(ec);
asio::detail::throw_error(ec, "non_blocking");
}
/// Sets the non-blocking mode of the socket.
@ -1151,7 +1151,7 @@ public:
{
asio::error_code ec;
this->service.native_non_blocking(this->implementation, mode, ec);
asio::detail::throw_error(ec);
asio::detail::throw_error(ec, "native_non_blocking");
}
/// Sets the non-blocking mode of the native socket implementation.
@ -1264,7 +1264,7 @@ public:
{
asio::error_code ec;
endpoint_type ep = this->service.local_endpoint(this->implementation, ec);
asio::detail::throw_error(ec);
asio::detail::throw_error(ec, "local_endpoint");
return ep;
}
@ -1313,7 +1313,7 @@ public:
{
asio::error_code ec;
endpoint_type ep = this->service.remote_endpoint(this->implementation, ec);
asio::detail::throw_error(ec);
asio::detail::throw_error(ec, "remote_endpoint");
return ep;
}
@ -1364,7 +1364,7 @@ public:
{
asio::error_code ec;
this->service.shutdown(this->implementation, what, ec);
asio::detail::throw_error(ec);
asio::detail::throw_error(ec, "shutdown");
}
/// Disable sends or receives on the socket.

View File

@ -101,7 +101,7 @@ public:
{
asio::error_code ec;
this->service.open(this->implementation, protocol, ec);
asio::detail::throw_error(ec);
asio::detail::throw_error(ec, "open");
}
/// Construct an acceptor opened on the given endpoint.
@ -137,18 +137,18 @@ public:
{
asio::error_code ec;
this->service.open(this->implementation, endpoint.protocol(), ec);
asio::detail::throw_error(ec);
asio::detail::throw_error(ec, "open");
if (reuse_addr)
{
this->service.set_option(this->implementation,
socket_base::reuse_address(true), ec);
asio::detail::throw_error(ec);
asio::detail::throw_error(ec, "set_option");
}
this->service.bind(this->implementation, endpoint, ec);
asio::detail::throw_error(ec);
asio::detail::throw_error(ec, "bind");
this->service.listen(this->implementation,
socket_base::max_connections, ec);
asio::detail::throw_error(ec);
asio::detail::throw_error(ec, "listen");
}
/// Construct a basic_socket_acceptor on an existing native acceptor.
@ -172,7 +172,7 @@ public:
{
asio::error_code ec;
this->service.assign(this->implementation, protocol, native_acceptor, ec);
asio::detail::throw_error(ec);
asio::detail::throw_error(ec, "assign");
}
/// Open the acceptor using the specified protocol.
@ -194,7 +194,7 @@ public:
{
asio::error_code ec;
this->service.open(this->implementation, protocol, ec);
asio::detail::throw_error(ec);
asio::detail::throw_error(ec, "open");
}
/// Open the acceptor using the specified protocol.
@ -238,7 +238,7 @@ public:
{
asio::error_code ec;
this->service.assign(this->implementation, protocol, native_acceptor, ec);
asio::detail::throw_error(ec);
asio::detail::throw_error(ec, "assign");
}
/// Assigns an existing native acceptor to the acceptor.
@ -285,7 +285,7 @@ public:
{
asio::error_code ec;
this->service.bind(this->implementation, endpoint, ec);
asio::detail::throw_error(ec);
asio::detail::throw_error(ec, "bind");
}
/// Bind the acceptor to the given local endpoint.
@ -330,7 +330,7 @@ public:
{
asio::error_code ec;
this->service.listen(this->implementation, backlog, ec);
asio::detail::throw_error(ec);
asio::detail::throw_error(ec, "listen");
}
/// Place the acceptor into the state where it will listen for new
@ -374,7 +374,7 @@ public:
{
asio::error_code ec;
this->service.close(this->implementation, ec);
asio::detail::throw_error(ec);
asio::detail::throw_error(ec, "close");
}
/// Close the acceptor.
@ -438,7 +438,7 @@ public:
{
asio::error_code ec;
this->service.cancel(this->implementation, ec);
asio::detail::throw_error(ec);
asio::detail::throw_error(ec, "cancel");
}
/// Cancel all asynchronous operations associated with the acceptor.
@ -480,7 +480,7 @@ public:
{
asio::error_code ec;
this->service.set_option(this->implementation, option, ec);
asio::detail::throw_error(ec);
asio::detail::throw_error(ec, "set_option");
}
/// Set an option on the acceptor.
@ -543,7 +543,7 @@ public:
{
asio::error_code ec;
this->service.get_option(this->implementation, option, ec);
asio::detail::throw_error(ec);
asio::detail::throw_error(ec, "get_option");
}
/// Get an option from the acceptor.
@ -605,7 +605,7 @@ public:
{
asio::error_code ec;
this->service.io_control(this->implementation, command, ec);
asio::detail::throw_error(ec);
asio::detail::throw_error(ec, "io_control");
}
/// Perform an IO control command on the acceptor.
@ -673,7 +673,7 @@ public:
{
asio::error_code ec;
this->service.non_blocking(this->implementation, mode, ec);
asio::detail::throw_error(ec);
asio::detail::throw_error(ec, "non_blocking");
}
/// Sets the non-blocking mode of the acceptor.
@ -733,7 +733,7 @@ public:
{
asio::error_code ec;
this->service.native_non_blocking(this->implementation, mode, ec);
asio::detail::throw_error(ec);
asio::detail::throw_error(ec, "native_non_blocking");
}
/// Sets the non-blocking mode of the native acceptor implementation.
@ -776,7 +776,7 @@ public:
{
asio::error_code ec;
endpoint_type ep = this->service.local_endpoint(this->implementation, ec);
asio::detail::throw_error(ec);
asio::detail::throw_error(ec, "local_endpoint");
return ep;
}
@ -830,7 +830,7 @@ public:
{
asio::error_code ec;
this->service.accept(this->implementation, peer, 0, ec);
asio::detail::throw_error(ec);
asio::detail::throw_error(ec, "accept");
}
/// Accept a new connection.
@ -943,7 +943,7 @@ public:
{
asio::error_code ec;
this->service.accept(this->implementation, peer, &peer_endpoint, ec);
asio::detail::throw_error(ec);
asio::detail::throw_error(ec, "accept");
}
/// Accept a new connection and obtain the endpoint of the peer

View File

@ -222,7 +222,7 @@ public:
asio::error_code ec;
timer_service_->expires_at(timer_implementation_, expiry_time, ec);
asio::detail::throw_error(ec);
asio::detail::throw_error(ec, "expires_at");
start_timer();
}
@ -251,7 +251,7 @@ public:
asio::error_code ec;
timer_service_->expires_from_now(timer_implementation_, expiry_time, ec);
asio::detail::throw_error(ec);
asio::detail::throw_error(ec, "expires_from_now");
start_timer();
}

View File

@ -163,7 +163,7 @@ public:
asio::error_code ec;
std::size_t s = this->service.send(
this->implementation, buffers, 0, ec);
asio::detail::throw_error(ec);
asio::detail::throw_error(ec, "send");
return s;
}
@ -201,7 +201,7 @@ public:
asio::error_code ec;
std::size_t s = this->service.send(
this->implementation, buffers, flags, ec);
asio::detail::throw_error(ec);
asio::detail::throw_error(ec, "send");
return s;
}
@ -358,7 +358,7 @@ public:
{
asio::error_code ec;
std::size_t s = this->service.receive(this->implementation, buffers, 0, ec);
asio::detail::throw_error(ec);
asio::detail::throw_error(ec, "receive");
return s;
}
@ -399,7 +399,7 @@ public:
asio::error_code ec;
std::size_t s = this->service.receive(
this->implementation, buffers, flags, ec);
asio::detail::throw_error(ec);
asio::detail::throw_error(ec, "receive");
return s;
}
@ -559,7 +559,7 @@ public:
{
asio::error_code ec;
std::size_t s = this->service.send(this->implementation, buffers, 0, ec);
asio::detail::throw_error(ec);
asio::detail::throw_error(ec, "write_some");
return s;
}
@ -666,7 +666,7 @@ public:
{
asio::error_code ec;
std::size_t s = this->service.receive(this->implementation, buffers, 0, ec);
asio::detail::throw_error(ec);
asio::detail::throw_error(ec, "read_some");
return s;
}

View File

@ -44,7 +44,7 @@ Iterator connect(basic_socket<Protocol, SocketService>& s, Iterator begin)
{
asio::error_code ec;
Iterator result = connect(s, begin, ec);
asio::detail::throw_error(ec);
asio::detail::throw_error(ec, "connect");
return result;
}
@ -61,7 +61,7 @@ Iterator connect(basic_socket<Protocol, SocketService>& s,
{
asio::error_code ec;
Iterator result = connect(s, begin, end, ec);
asio::detail::throw_error(ec);
asio::detail::throw_error(ec, "connect");
return result;
}
@ -79,7 +79,7 @@ Iterator connect(basic_socket<Protocol, SocketService>& s,
{
asio::error_code ec;
Iterator result = connect(s, begin, connect_condition, ec);
asio::detail::throw_error(ec);
asio::detail::throw_error(ec, "connect");
return result;
}
@ -99,7 +99,7 @@ Iterator connect(basic_socket<Protocol, SocketService>& s,
{
asio::error_code ec;
Iterator result = connect(s, begin, end, connect_condition, ec);
asio::detail::throw_error(ec);
asio::detail::throw_error(ec, "connect");
return result;
}

View File

@ -58,7 +58,7 @@ inline std::size_t read(SyncReadStream& s, const MutableBufferSequence& buffers)
{
asio::error_code ec;
std::size_t bytes_transferred = read(s, buffers, transfer_all(), ec);
asio::detail::throw_error(ec);
asio::detail::throw_error(ec, "read");
return bytes_transferred;
}
@ -76,7 +76,7 @@ inline std::size_t read(SyncReadStream& s, const MutableBufferSequence& buffers,
{
asio::error_code ec;
std::size_t bytes_transferred = read(s, buffers, completion_condition, ec);
asio::detail::throw_error(ec);
asio::detail::throw_error(ec, "read");
return bytes_transferred;
}
@ -111,7 +111,7 @@ inline std::size_t read(SyncReadStream& s,
{
asio::error_code ec;
std::size_t bytes_transferred = read(s, b, transfer_all(), ec);
asio::detail::throw_error(ec);
asio::detail::throw_error(ec, "read");
return bytes_transferred;
}
@ -131,7 +131,7 @@ inline std::size_t read(SyncReadStream& s,
{
asio::error_code ec;
std::size_t bytes_transferred = read(s, b, completion_condition, ec);
asio::detail::throw_error(ec);
asio::detail::throw_error(ec, "read");
return bytes_transferred;
}

View File

@ -62,7 +62,7 @@ inline std::size_t read_at(SyncRandomAccessReadDevice& d,
asio::error_code ec;
std::size_t bytes_transferred = read_at(
d, offset, buffers, transfer_all(), ec);
asio::detail::throw_error(ec);
asio::detail::throw_error(ec, "read_at");
return bytes_transferred;
}
@ -83,7 +83,7 @@ inline std::size_t read_at(SyncRandomAccessReadDevice& d,
asio::error_code ec;
std::size_t bytes_transferred = read_at(
d, offset, buffers, completion_condition, ec);
asio::detail::throw_error(ec);
asio::detail::throw_error(ec, "read_at");
return bytes_transferred;
}
@ -120,7 +120,7 @@ inline std::size_t read_at(SyncRandomAccessReadDevice& d,
asio::error_code ec;
std::size_t bytes_transferred = read_at(
d, offset, b, transfer_all(), ec);
asio::detail::throw_error(ec);
asio::detail::throw_error(ec, "read_at");
return bytes_transferred;
}
@ -141,7 +141,7 @@ inline std::size_t read_at(SyncRandomAccessReadDevice& d,
asio::error_code ec;
std::size_t bytes_transferred = read_at(
d, offset, b, completion_condition, ec);
asio::detail::throw_error(ec);
asio::detail::throw_error(ec, "read_at");
return bytes_transferred;
}

View File

@ -38,7 +38,7 @@ inline std::size_t read_until(SyncReadStream& s,
{
asio::error_code ec;
std::size_t bytes_transferred = read_until(s, b, delim, ec);
asio::detail::throw_error(ec);
asio::detail::throw_error(ec, "read_until");
return bytes_transferred;
}
@ -94,7 +94,7 @@ inline std::size_t read_until(SyncReadStream& s,
{
asio::error_code ec;
std::size_t bytes_transferred = read_until(s, b, delim, ec);
asio::detail::throw_error(ec);
asio::detail::throw_error(ec, "read_until");
return bytes_transferred;
}
@ -194,7 +194,7 @@ inline std::size_t read_until(SyncReadStream& s,
{
asio::error_code ec;
std::size_t bytes_transferred = read_until(s, b, expr, ec);
asio::detail::throw_error(ec);
asio::detail::throw_error(ec, "read_until");
return bytes_transferred;
}
@ -314,7 +314,7 @@ inline std::size_t read_until(SyncReadStream& s,
{
asio::error_code ec;
std::size_t bytes_transferred = read_until(s, b, match_condition, ec);
asio::detail::throw_error(ec);
asio::detail::throw_error(ec, "read_until");
return bytes_transferred;
}

View File

@ -56,7 +56,7 @@ inline std::size_t write(SyncWriteStream& s, const ConstBufferSequence& buffers)
{
asio::error_code ec;
std::size_t bytes_transferred = write(s, buffers, transfer_all(), ec);
asio::detail::throw_error(ec);
asio::detail::throw_error(ec, "write");
return bytes_transferred;
}
@ -74,7 +74,7 @@ inline std::size_t write(SyncWriteStream& s, const ConstBufferSequence& buffers,
{
asio::error_code ec;
std::size_t bytes_transferred = write(s, buffers, completion_condition, ec);
asio::detail::throw_error(ec);
asio::detail::throw_error(ec, "write");
return bytes_transferred;
}
@ -97,7 +97,7 @@ inline std::size_t write(SyncWriteStream& s,
{
asio::error_code ec;
std::size_t bytes_transferred = write(s, b, transfer_all(), ec);
asio::detail::throw_error(ec);
asio::detail::throw_error(ec, "write");
return bytes_transferred;
}
@ -117,7 +117,7 @@ inline std::size_t write(SyncWriteStream& s,
{
asio::error_code ec;
std::size_t bytes_transferred = write(s, b, completion_condition, ec);
asio::detail::throw_error(ec);
asio::detail::throw_error(ec, "write");
return bytes_transferred;
}

View File

@ -60,7 +60,7 @@ inline std::size_t write_at(SyncRandomAccessWriteDevice& d,
asio::error_code ec;
std::size_t bytes_transferred = write_at(
d, offset, buffers, transfer_all(), ec);
asio::detail::throw_error(ec);
asio::detail::throw_error(ec, "write_at");
return bytes_transferred;
}
@ -81,7 +81,7 @@ inline std::size_t write_at(SyncRandomAccessWriteDevice& d,
asio::error_code ec;
std::size_t bytes_transferred = write_at(
d, offset, buffers, completion_condition, ec);
asio::detail::throw_error(ec);
asio::detail::throw_error(ec, "write_at");
return bytes_transferred;
}
@ -105,7 +105,7 @@ inline std::size_t write_at(SyncRandomAccessWriteDevice& d,
{
asio::error_code ec;
std::size_t bytes_transferred = write_at(d, offset, b, transfer_all(), ec);
asio::detail::throw_error(ec);
asio::detail::throw_error(ec, "write_at");
return bytes_transferred;
}
@ -126,7 +126,7 @@ inline std::size_t write_at(SyncRandomAccessWriteDevice& d,
asio::error_code ec;
std::size_t bytes_transferred = write_at(
d, offset, b, completion_condition, ec);
asio::detail::throw_error(ec);
asio::detail::throw_error(ec, "write_at");
return bytes_transferred;
}

View File

@ -99,7 +99,7 @@ public:
{
asio::error_code ec;
iterator i = this->service.resolve(this->implementation, q, ec);
asio::detail::throw_error(ec);
asio::detail::throw_error(ec, "resolve");
return i;
}
@ -185,7 +185,7 @@ public:
{
asio::error_code ec;
iterator i = this->service.resolve(this->implementation, e, ec);
asio::detail::throw_error(ec);
asio::detail::throw_error(ec, "resolve");
return i;
}

View File

@ -51,7 +51,7 @@ inline void connect_pair(
{
asio::error_code ec;
connect_pair(socket1, socket2, ec);
asio::detail::throw_error(ec);
asio::detail::throw_error(ec, "connect_pair");
}
template <typename Protocol, typename SocketService1, typename SocketService2>

View File

@ -87,7 +87,7 @@ public:
{
asio::error_code ec;
this->service.assign(this->implementation, native_descriptor, ec);
asio::detail::throw_error(ec);
asio::detail::throw_error(ec, "assign");
}
/// Get a reference to the lowest layer.
@ -130,7 +130,7 @@ public:
{
asio::error_code ec;
this->service.assign(this->implementation, native_descriptor, ec);
asio::detail::throw_error(ec);
asio::detail::throw_error(ec, "assign");
}
/// Assign an existing native descriptor to the descriptor.
@ -165,7 +165,7 @@ public:
{
asio::error_code ec;
this->service.close(this->implementation, ec);
asio::detail::throw_error(ec);
asio::detail::throw_error(ec, "close");
}
/// Close the descriptor.
@ -231,7 +231,7 @@ public:
{
asio::error_code ec;
this->service.cancel(this->implementation, ec);
asio::detail::throw_error(ec);
asio::detail::throw_error(ec, "cancel");
}
/// Cancel all asynchronous operations associated with the descriptor.
@ -274,7 +274,7 @@ public:
{
asio::error_code ec;
this->service.io_control(this->implementation, command, ec);
asio::detail::throw_error(ec);
asio::detail::throw_error(ec, "io_control");
}
/// Perform an IO control command on the descriptor.
@ -344,7 +344,7 @@ public:
{
asio::error_code ec;
this->service.non_blocking(this->implementation, mode, ec);
asio::detail::throw_error(ec);
asio::detail::throw_error(ec, "non_blocking");
}
/// Sets the non-blocking mode of the descriptor.
@ -404,7 +404,7 @@ public:
{
asio::error_code ec;
this->service.native_non_blocking(this->implementation, mode, ec);
asio::detail::throw_error(ec);
asio::detail::throw_error(ec, "native_non_blocking");
}
/// Sets the non-blocking mode of the native descriptor implementation.

View File

@ -123,7 +123,7 @@ public:
{
asio::error_code ec;
std::size_t s = this->service.write_some(this->implementation, buffers, ec);
asio::detail::throw_error(ec);
asio::detail::throw_error(ec, "write_some");
return s;
}
@ -230,7 +230,7 @@ public:
{
asio::error_code ec;
std::size_t s = this->service.read_some(this->implementation, buffers, ec);
asio::detail::throw_error(ec);
asio::detail::throw_error(ec, "read_some");
return s;
}

View File

@ -83,7 +83,7 @@ public:
{
asio::error_code ec;
this->service.assign(this->implementation, handle, ec);
asio::detail::throw_error(ec);
asio::detail::throw_error(ec, "assign");
}
/// Get a reference to the lowest layer.
@ -126,7 +126,7 @@ public:
{
asio::error_code ec;
this->service.assign(this->implementation, handle, ec);
asio::detail::throw_error(ec);
asio::detail::throw_error(ec, "assign");
}
/// Assign an existing native handle to the handle.
@ -161,7 +161,7 @@ public:
{
asio::error_code ec;
this->service.close(this->implementation, ec);
asio::detail::throw_error(ec);
asio::detail::throw_error(ec, "close");
}
/// Close the handle.
@ -211,7 +211,7 @@ public:
{
asio::error_code ec;
this->service.cancel(this->implementation, ec);
asio::detail::throw_error(ec);
asio::detail::throw_error(ec, "cancel");
}
/// Cancel all asynchronous operations associated with the handle.

View File

@ -123,7 +123,7 @@ public:
asio::error_code ec;
std::size_t s = this->service.write_some_at(
this->implementation, offset, buffers, ec);
asio::detail::throw_error(ec);
asio::detail::throw_error(ec, "write_some_at");
return s;
}
@ -239,7 +239,7 @@ public:
asio::error_code ec;
std::size_t s = this->service.read_some_at(
this->implementation, offset, buffers, ec);
asio::detail::throw_error(ec);
asio::detail::throw_error(ec, "read_some_at");
return s;
}

View File

@ -120,7 +120,7 @@ public:
{
asio::error_code ec;
std::size_t s = this->service.write_some(this->implementation, buffers, ec);
asio::detail::throw_error(ec);
asio::detail::throw_error(ec, "write_some");
return s;
}
@ -227,7 +227,7 @@ public:
{
asio::error_code ec;
std::size_t s = this->service.read_some(this->implementation, buffers, ec);
asio::detail::throw_error(ec);
asio::detail::throw_error(ec, "read_some");
return s;
}