summaryrefslogtreecommitdiff
path: root/src/mongo/transport/asio_utils.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/mongo/transport/asio_utils.h')
-rw-r--r--src/mongo/transport/asio_utils.h5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/mongo/transport/asio_utils.h b/src/mongo/transport/asio_utils.h
index 7590c3ddfd6..bce3cb708e0 100644
--- a/src/mongo/transport/asio_utils.h
+++ b/src/mongo/transport/asio_utils.h
@@ -129,6 +129,7 @@ inline HostAndPort endpointToHostAndPort(const asio::generic::stream_protocol::e
}
Status errorCodeToStatus(const std::error_code& ec);
+Status errorCodeToStatus(const std::error_code& ec, StringData context);
/**
* The ASIO implementation of poll (i.e. socket.wait()) cannot poll for a mask of events, and
@@ -163,7 +164,7 @@ size_t peekASIOStream(Stream& stream, const MutableBufferSequence& buffers) {
// actually an error condition for our purposes, we ignore these two
// errors.
if (ec != asio::error::would_block && ec != asio::error::try_again) {
- uassertStatusOK(errorCodeToStatus(ec));
+ uassertStatusOK(errorCodeToStatus(ec, "peekASIOStream"));
}
return bytesRead;
@@ -297,7 +298,7 @@ private:
template <typename... As>
void _onInvoke(std::error_code ec, As&&... args) {
if (ec) {
- promise.setError(errorCodeToStatus(ec));
+ promise.setError(errorCodeToStatus(ec, "onInvoke"));
return;
}
_onSuccess(std::forward<As>(args)...);