diff options
author | Max Kellermann <max@musicpd.org> | 2016-11-02 10:38:05 +0100 |
---|---|---|
committer | Max Kellermann <max@musicpd.org> | 2016-11-02 10:38:05 +0100 |
commit | e2b7c30811a40f9600cf1138d0cccea587599a82 (patch) | |
tree | b61e84493b15e75861ccb246f78a4c0bb2dfa424 /src/event/FullyBufferedSocket.cxx | |
parent | c8bb3c0b717bc0cd4fdfb40093963ce01a2d269b (diff) |
event/BufferedSocket: pass std::exception_ptr to OnSocketError()
Diffstat (limited to 'src/event/FullyBufferedSocket.cxx')
-rw-r--r-- | src/event/FullyBufferedSocket.cxx | 10 |
1 files changed, 2 insertions, 8 deletions
diff --git a/src/event/FullyBufferedSocket.cxx b/src/event/FullyBufferedSocket.cxx index 21a038044..b464e83b9 100644 --- a/src/event/FullyBufferedSocket.cxx +++ b/src/event/FullyBufferedSocket.cxx @@ -20,8 +20,6 @@ #include "config.h" #include "FullyBufferedSocket.hxx" #include "net/SocketError.hxx" -#include "util/Error.hxx" -#include "util/Domain.hxx" #include "Compiler.h" #include <assert.h> @@ -42,7 +40,7 @@ FullyBufferedSocket::DirectWrite(const void *data, size_t length) if (IsSocketErrorClosed(code)) OnSocketClosed(); else - OnSocketError(NewSocketError(code)); + OnSocketError(std::make_exception_ptr(MakeSocketError(code, "Failed to send to socket"))); } return nbytes; @@ -85,11 +83,7 @@ FullyBufferedSocket::Write(const void *data, size_t length) const bool was_empty = output.IsEmpty(); if (!output.Append(data, length)) { - // TODO - static constexpr Domain buffered_socket_domain("buffered_socket"); - Error error; - error.Set(buffered_socket_domain, "Output buffer is full"); - OnSocketError(std::move(error)); + OnSocketError(std::make_exception_ptr(std::runtime_error("Output buffer is full"))); return false; } |