mirror of
https://github.com/qbittorrent/qBittorrent.git
synced 2025-12-22 00:17:23 -06:00
- Catch exception thrown by resolver.resolve() and display the error message on stderr
This commit is contained in:
@@ -70,10 +70,14 @@ signals:
|
|||||||
|
|
||||||
protected:
|
protected:
|
||||||
void run() {
|
void run() {
|
||||||
|
try {
|
||||||
boost::asio::ip::tcp::resolver::iterator it = resolver.resolve(ip);
|
boost::asio::ip::tcp::resolver::iterator it = resolver.resolve(ip);
|
||||||
if(stopped) return;
|
if(stopped) return;
|
||||||
boost::asio::ip::tcp::endpoint endpoint = *it;
|
boost::asio::ip::tcp::endpoint endpoint = *it;
|
||||||
emit ip_resolved(misc::toQString(endpoint.address().to_string()), misc::toQString((*it).host_name()));
|
emit ip_resolved(misc::toQString(endpoint.address().to_string()), misc::toQString((*it).host_name()));
|
||||||
|
} catch(std::exception &e) {
|
||||||
|
std::cerr << "Hostname resolution failed, reason: " << e.what() << std::endl;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user