forked from qt-creator/qt-creator
SSH: Catch std::exception rather than Botan-specific ones
In particular, the existence of Botan::Exception wrongly suggests that it is the parent class of all Botan-specific exceptions. This assumption, combined with a different bug that will be fixed in a follow-up commit, caused a crash in the key generator. Change-Id: I0aafb761052d185051df217c9914010235a7c77b Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
This commit is contained in:
@@ -199,7 +199,7 @@ int SshConnection::closeAllChannels()
|
||||
{
|
||||
try {
|
||||
return d->m_channelManager->closeAllChannels(Internal::SshChannelManager::CloseAllRegular);
|
||||
} catch (const Botan::Exception &e) {
|
||||
} catch (const std::exception &e) {
|
||||
qCWarning(Internal::sshLog, "%s: %s", Q_FUNC_INFO, e.what());
|
||||
return -1;
|
||||
}
|
||||
@@ -344,7 +344,7 @@ void SshConnectionPrivate::handleIncomingData()
|
||||
} catch (const SshClientException &e) {
|
||||
closeConnection(SSH_DISCONNECT_BY_APPLICATION, e.error, "",
|
||||
e.errorString);
|
||||
} catch (const Botan::Exception &e) {
|
||||
} catch (const std::exception &e) {
|
||||
closeConnection(SSH_DISCONNECT_BY_APPLICATION, SshInternalError, "",
|
||||
tr("Botan library exception: %1").arg(QString::fromLatin1(e.what())));
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user