Commit 455087d4 authored by Ismael Asensio's avatar Ismael Asensio Committed by Nate Graham
Browse files

PackageKitUpdater: Do not emit error when user cancels an update

A succesful cancelation is notified by the backend via the error
code `PackageKit::Transaction::ErrorTransactionCancelled`.

Do not emit an error message in this case, as it is the expected
outcome.

The same condition is used in PKTransaction.cpp:299

BEFORE:
![Screenshot_20220118_210009](/uploads/da7aeedcf88f67c3541fb3b61178951e/Screenshot_20220118_210009.png)
parent fa98bbb3
Pipeline #125720 passed with stage
in 1 minute and 11 seconds
......@@ -296,8 +296,10 @@ void PKTransaction::eulaRequired(const QString &eulaID, const QString &packageID
void PKTransaction::errorFound(PackageKit::Transaction::Error err, const QString &error)
{
if (err == PackageKit::Transaction::ErrorNoLicenseAgreement || err == PackageKit::Transaction::ErrorTransactionCancelled)
if (err == PackageKit::Transaction::ErrorNoLicenseAgreement || err == PackageKit::Transaction::ErrorTransactionCancelled
|| err == PackageKit::Transaction::ErrorNotAuthorized) {
return;
}
qWarning() << "PackageKit error:" << err << PackageKitMessages::errorMessage(err) << error;
Q_EMIT passiveMessage(PackageKitMessages::errorMessage(err));
}
......
......@@ -553,8 +553,10 @@ void PackageKitUpdater::cancel()
void PackageKitUpdater::errorFound(PackageKit::Transaction::Error err, const QString &error)
{
if (err == PackageKit::Transaction::ErrorNoLicenseAgreement)
if (err == PackageKit::Transaction::ErrorNoLicenseAgreement || err == PackageKit::Transaction::ErrorTransactionCancelled
|| err == PackageKit::Transaction::ErrorNotAuthorized) {
return;
}
QString finalMessage = xi18nc("@info", "%1:<nl/><nl/>%2", PackageKitMessages::errorMessage(err), error);
Q_EMIT passiveMessage(finalMessage);
qWarning() << "Error happened" << err << error;
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment