File tree Expand file tree Collapse file tree 2 files changed +21
-1
lines changed
Expand file tree Collapse file tree 2 files changed +21
-1
lines changed Original file line number Diff line number Diff line change 77#include " net/SocketAddress.hxx"
88#include " net/AddressInfo.hxx"
99#include " net/SocketError.hxx"
10+ #include " net/TimeoutError.hxx"
1011
1112#include < cassert>
1213#include < stdexcept>
1516ConnectSocketHandler::OnSocketConnectTimeout () noexcept
1617{
1718 /* default implementation falls back to OnSocketConnectError() */
18- OnSocketConnectError (std::make_exception_ptr (std::runtime_error ( " Connect timeout" ) ));
19+ OnSocketConnectError (std::make_exception_ptr (TimeoutError{ " Connect timeout" } ));
1920}
2021
2122ConnectSocket::ConnectSocket (EventLoop &_event_loop,
Original file line number Diff line number Diff line change 1+ // SPDX-License-Identifier: BSD-2-Clause
2+ // Copyright CM4all GmbH
3+ // author: Max Kellermann <[email protected] >4+
5+ #pragma once
6+
7+ #include < stdexcept>
8+
9+ /* *
10+ * Some operation has timed out (e.g. connecting to a server, waiting
11+ * for reply from a server).
12+ */
13+ class TimeoutError : public std ::runtime_error {
14+ public:
15+ using std::runtime_error::runtime_error;
16+
17+ TimeoutError () noexcept
18+ :std::runtime_error(" Timeout" ) {}
19+ };
You can’t perform that action at this time.
0 commit comments