dbhub: Better error handling

This commit is contained in:
Martin Kleusberg
2020-07-15 11:30:42 +02:00
parent bee8cfc67e
commit 7fce5f98a8
2 changed files with 3 additions and 2 deletions

View File

@@ -170,7 +170,7 @@ void RemoteDatabase::gotReply(QNetworkReply* reply)
if(reply->error() != QNetworkReply::NoError)
{
QMessageBox::warning(nullptr, qApp->applicationName(),
tr("Error when connecting to %1.\n%2").arg(reply->url().toString(), reply->errorString()));
reply->errorString() + "\n" + reply->readAll());
reply->deleteLater();
return;
}

View File

@@ -38,7 +38,8 @@ RemoteDock::RemoteDock(MainWindow* parent)
connect(&remoteDatabase, &RemoteDatabase::uploadFinished, remoteModel, &RemoteModel::refresh);
connect(&remoteDatabase, &RemoteDatabase::uploadFinished, this, &RemoteDock::refreshLocalFileList);
connect(&remoteDatabase, &RemoteDatabase::uploadFinished, [this]() {
refreshMetadata(currently_opened_file_info.user_name(), QString::fromStdString(currently_opened_file_info.name));
if(!currently_opened_file_info.file.empty())
refreshMetadata(currently_opened_file_info.user_name(), QString::fromStdString(currently_opened_file_info.name));
});
connect(&remoteDatabase, &RemoteDatabase::openFile, this, &RemoteDock::refreshLocalFileList);