From 6a008acb2b7dcfe6a1f5d45ebfa840887189934d Mon Sep 17 00:00:00 2001 From: BruebachL <44814898+BruebachL@users.noreply.github.com> Date: Tue, 18 Feb 2025 23:20:06 +0100 Subject: [PATCH] Enhance card update error description. (#5638) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * Enhance card update error description. * Enhance card update error description. * Lint. --------- Co-authored-by: Lukas BrĂ¼bach --- cockatrice/src/client/ui/window_main.cpp | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/cockatrice/src/client/ui/window_main.cpp b/cockatrice/src/client/ui/window_main.cpp index 167e93e23..9e5129bf1 100644 --- a/cockatrice/src/client/ui/window_main.cpp +++ b/cockatrice/src/client/ui/window_main.cpp @@ -1213,28 +1213,31 @@ void MainWindow::cardUpdateError(QProcess::ProcessError err) QString error; switch (err) { case QProcess::FailedToStart: - error = tr("failed to start."); + error = tr("Failed to start. The file might be missing, or permissions might be incorrect."); break; case QProcess::Crashed: - error = tr("crashed."); + error = tr("The process crashed some time after starting successfully."); + error += "\n\nError output:\n" + cardUpdateProcess->readAllStandardError(); break; case QProcess::Timedout: - error = tr("timed out."); + error = tr("Timed out. The process took too long to respond. The last waitFor...() function timed out."); break; case QProcess::WriteError: - error = tr("write error."); + error = tr("An error occurred when attempting to write to the process. For example, the process may " + "not be running, or it may have closed its input channel."); break; case QProcess::ReadError: - error = tr("read error."); + error = tr("An error occurred when attempting to read from the process. For example, the process may " + "not be running."); break; case QProcess::UnknownError: default: - error = tr("unknown error."); + error = tr("Unknown error occurred."); break; } exitCardDatabaseUpdate(); - QMessageBox::warning(this, tr("Error"), tr("The card database updater exited with an error: %1").arg(error)); + QMessageBox::warning(this, tr("Error"), tr("The card database updater exited with an error:\n%1").arg(error)); } void MainWindow::cardUpdateFinished(int, QProcess::ExitStatus)