]> git.saurik.com Git - apt.git/commitdiff
report all instead of first error up the acquire chain
authorDavid Kalnischkies <david@kalnischkies.de>
Wed, 6 Jul 2016 13:10:52 +0000 (15:10 +0200)
committerJulian Andres Klode <jak@debian.org>
Wed, 31 Aug 2016 11:49:37 +0000 (13:49 +0200)
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
methods/https.cc

index 82f4b626d08486fe32091105a3fda3470975de7d..646e961969cf1f692794d9cfecf96b157826dc6d 100644 (file)
@@ -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                                        /*{{{*/
index fc439bef85fe2ea47324531ed4eb36b44ff851e5..82c6a1ae20a6a0fc306bde5829d3254680383ded 100644 (file)
@@ -437,7 +437,13 @@ bool HttpsMethod::Fetch(FetchItem *Itm)
            break;
       }
 #pragma GCC diagnostic pop
-      return _error->Error("%s", curl_errorstr);
+      // only take curls technical errors if we haven't our own
+      // (e.g. for the maximum size limit we have and curls can be confusing)
+      if (_error->PendingError() == false)
+        _error->Error("%s", curl_errorstr);
+      else
+        _error->Warning("curl: %s", curl_errorstr);
+      return false;
    }
 
    // server says file not modified