From d3bea965a0dd9fe17b262476c03b378c989094b1 Mon Sep 17 00:00:00 2001 From: David Kalnischkies Date: Wed, 6 Jul 2016 15:10:52 +0200 Subject: 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) --- apt-pkg/acquire-method.cc | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) (limited to 'apt-pkg') 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 /*{{{*/ -- cgit v1.2.3