Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions src/plugins/output/forwarder/src/Connection.h
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@
#include <unordered_map>
#include <memory>
#include <atomic>
#include <exception>

#include <ipfixcol2.h>

Expand All @@ -55,7 +56,7 @@
class Connection;

/// An error to be thrown on connection errors
class ConnectionError {
class ConnectionError : std::exception {
public:
ConnectionError(std::string message)
: m_message(message) {}
Expand All @@ -66,7 +67,7 @@ class ConnectionError {
ConnectionError with_connection(std::shared_ptr<Connection> &connection) const
{ return ConnectionError(m_message, connection); }

const char *what() const { return m_message.c_str(); }
const char *what() const noexcept { return m_message.c_str(); }

std::shared_ptr<Connection> *connection() const { return m_connection; }

Expand Down
6 changes: 5 additions & 1 deletion src/plugins/output/forwarder/src/Host.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,11 @@ Host::advance_transfers()
for (auto &p : m_session_to_connection) {
Connection &connection = *p.second.get();
if (connection.check_connected()) {
connection.advance_transfers();
try {
connection.advance_transfers();
} catch (const ConnectionError &) {
// Ignore...
}
}
}
}
Expand Down
Loading