Enhance card update error description. (#5638)

* Enhance card update error description.

* Enhance card update error description.

* Lint.

---------

Co-authored-by: Lukas Brübach <Bruebach.Lukas@bdosecurity.de>
This commit is contained in:
BruebachL 2025-02-18 23:20:06 +01:00 committed by GitHub
parent 247e1aff83
commit 6a008acb2b
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -1213,28 +1213,31 @@ void MainWindow::cardUpdateError(QProcess::ProcessError err)
QString error; QString error;
switch (err) { switch (err) {
case QProcess::FailedToStart: case QProcess::FailedToStart:
error = tr("failed to start."); error = tr("Failed to start. The file might be missing, or permissions might be incorrect.");
break; break;
case QProcess::Crashed: case QProcess::Crashed:
error = tr("crashed."); error = tr("The process crashed some time after starting successfully.");
error += "\n\nError output:\n" + cardUpdateProcess->readAllStandardError();
break; break;
case QProcess::Timedout: 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; break;
case QProcess::WriteError: 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; break;
case QProcess::ReadError: 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; break;
case QProcess::UnknownError: case QProcess::UnknownError:
default: default:
error = tr("unknown error."); error = tr("Unknown error occurred.");
break; break;
} }
exitCardDatabaseUpdate(); 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) void MainWindow::cardUpdateFinished(int, QProcess::ExitStatus)