]> 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)
committerDavid Kalnischkies <david@kalnischkies.de>
Wed, 6 Jul 2016 13:53:59 +0000 (15:53 +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.

apt-pkg/acquire-method.cc
methods/https.cc

index a9fff661b49fe08741287fa2d9d09111f17ba857..39d5e61f2acb1ab10d4009f9bad60bfa26672fa5 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 92f786d1706d6e21da3de9c5dd09f6bad37077de..bbdbd8fa9d2fc0133907a8a7c762c524de67e6bb 100644 (file)
@@ -436,7 +436,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