Commit 794e2f3f authored by Jonathan Thomas's avatar Jonathan Thomas
Browse files

Innocuous errors can occur at certain times during the execution of downloadSize() can

cause initialization errors, so discard all errors incurred in this function.

BUG:265741
parent d0cf4396
......@@ -363,6 +363,12 @@ qint64 Backend::downloadSize() const
// Raw size, ignoring already-downloaded or partially downloaded archives
qint64 downloadSize = d->cache->depCache()->DebSize();
// If downloadSize() is called during a cache refresh, there is a chance it
// will do so at a bad time and produce an error. Discard any errors that
// happen during this function, since they will always be innocuous and at
// worst will result in the less accurate DebSize() number being returned
_error->PushToStack();
// If possible, get what really needs to be downloaded
pkgAcquire fetcher;
pkgPackageManager *PM = _system->CreatePM(d->cache->depCache());
......@@ -371,6 +377,9 @@ qint64 Backend::downloadSize() const
}
delete PM;
_error->Discard();
_error->RevertToStack();
return downloadSize;
}
......
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