Apply suggestions from code review

Co-authored-by: TheKodeToad <TheKodeToad@proton.me>
Signed-off-by: Alexandru Ionut Tripon <alexandru.tripon97@gmail.com>
This commit is contained in:
Alexandru Ionut Tripon
2025-01-21 16:45:40 +02:00
committed by GitHub
parent 0a71b19509
commit 38d3f14f06

View File

@ -265,9 +265,9 @@ void ProfileSetupDialog::setupProfileFinished()
auto parsedError = MojangError::fromJSON(*m_profile_response); auto parsedError = MojangError::fromJSON(*m_profile_response);
ui->errorLabel->setVisible(true); ui->errorLabel->setVisible(true);
QString errorMessage = tr("Network error(%1): %2: HTTP Status: %3") QString errorMessage =
.arg(QString::number(m_profile_task->error()), m_profile_task->errorString(), tr("Network Error: %1\nHTTP Status: %2").arg(m_profile_task->errorString(), QString::number(m_profile_task->replyStatusCode()));
QString::number(m_profile_task->replyStatusCode()));
if (parsedError.fullyParsed) { if (parsedError.fullyParsed) {
errorMessage += "Path: " + parsedError.path + "\n"; errorMessage += "Path: " + parsedError.path + "\n";
@ -278,7 +278,7 @@ void ProfileSetupDialog::setupProfileFinished()
errorMessage += "Log:\n" + parsedError.rawError + "\n"; errorMessage += "Log:\n" + parsedError.rawError + "\n";
} }
ui->errorLabel->setText(tr("The server returned the following error:") + "\n\n" + errorMessage); ui->errorLabel->setText(tr("The server responded with the following error:") + "\n\n" + errorMessage);
qDebug() << parsedError.rawError; qDebug() << parsedError.rawError;
auto button = ui->buttonBox->button(QDialogButtonBox::Cancel); auto button = ui->buttonBox->button(QDialogButtonBox::Cancel);
button->setEnabled(true); button->setEnabled(true);