mirror of
https://github.com/d47081/qBittorrent.git
synced 2025-01-11 07:18:08 +00:00
- Made peer addition more robust by catching exceptions
This commit is contained in:
parent
94f3323270
commit
490ef19e64
@ -121,8 +121,12 @@ void PeerListWidget::showPeerListMenu(QPoint) {
|
|||||||
if(act == addPeerAct) {
|
if(act == addPeerAct) {
|
||||||
boost::asio::ip::tcp::endpoint ep = PeerAdditionDlg::askForPeerEndpoint();
|
boost::asio::ip::tcp::endpoint ep = PeerAdditionDlg::askForPeerEndpoint();
|
||||||
if(ep != boost::asio::ip::tcp::endpoint()) {
|
if(ep != boost::asio::ip::tcp::endpoint()) {
|
||||||
h.connect_peer(ep);
|
try {
|
||||||
QMessageBox::information(0, tr("Peer addition"), tr("The peer was added to this torrent."));
|
h.connect_peer(ep);
|
||||||
|
QMessageBox::information(0, tr("Peer addition"), tr("The peer was added to this torrent."));
|
||||||
|
} catch(std::exception) {
|
||||||
|
QMessageBox::critical(0, tr("Peer addition"), tr("The peer could not be added to this torrent."));
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
qDebug("No peer was added");
|
qDebug("No peer was added");
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user