summaryrefslogtreecommitdiff
path: root/apt-pkg/acquire-method.cc
diff options
context:
space:
mode:
authorDavid Kalnischkies <david@kalnischkies.de>2016-07-06 15:10:52 +0200
committerJulian Andres Klode <jak@debian.org>2016-08-31 13:49:37 +0200
commitd3bea965a0dd9fe17b262476c03b378c989094b1 (patch)
tree1e810f38f7839997e2348e2072280f13f15cadf3 /apt-pkg/acquire-method.cc
parent366021988e2c7a7a6ca29d4f6876bb1e6c8b181f (diff)
report all instead of first error up the acquire chain
If we don't give a specific error to report up it is likely that all error currently in the error stack are equally important, so reporting just one could turn out to be confusing e.g. if name resolution failed in a SRV record list. (cherry picked from commit b50dfa6b2dd2d459e0c2746ac9367982b96ffac0)
Diffstat (limited to 'apt-pkg/acquire-method.cc')
-rw-r--r--apt-pkg/acquire-method.cc17
1 files changed, 14 insertions, 3 deletions
diff --git a/apt-pkg/acquire-method.cc b/apt-pkg/acquire-method.cc
index 82f4b626d..646e96196 100644
--- a/apt-pkg/acquire-method.cc
+++ b/apt-pkg/acquire-method.cc
@@ -80,9 +80,20 @@ void pkgAcqMethod::Fail(bool Transient)
{
string Err = "Undetermined Error";
if (_error->empty() == false)
- _error->PopMessage(Err);
- _error->Discard();
- Fail(Err,Transient);
+ {
+ Err.clear();
+ while (_error->empty() == false)
+ {
+ std::string msg;
+ if (_error->PopMessage(msg))
+ {
+ if (Err.empty() == false)
+ Err.append("\n");
+ Err.append(msg);
+ }
+ }
+ }
+ Fail(Err, Transient);
}
/*}}}*/
// AcqMethod::Fail - A fetch has failed /*{{{*/