summaryrefslogtreecommitdiff
path: root/methods
diff options
context:
space:
mode:
authorMichael Vogt <michael.vogt@ubuntu.com>2007-02-05 17:52:28 +0100
committerMichael Vogt <michael.vogt@ubuntu.com>2007-02-05 17:52:28 +0100
commit59271f62e4a291c8d96e1f6073203c395734b6ca (patch)
tree114963f118d57bafc02b273dfdb1d4b972527c9a /methods
parent361593e92a44255cc0ef98417e7457911716cab5 (diff)
* use pkgAcqMethod::FailReason() for consistent error reporting
Diffstat (limited to 'methods')
-rw-r--r--methods/connect.cc1
-rw-r--r--methods/http.cc3
-rw-r--r--methods/mirror.cc12
3 files changed, 7 insertions, 9 deletions
diff --git a/methods/connect.cc b/methods/connect.cc
index 4e227c3fd..145001fb3 100644
--- a/methods/connect.cc
+++ b/methods/connect.cc
@@ -163,6 +163,7 @@ bool Connect(string Host,int Port,const char *Service,int DefPort,int &Fd,
DefPort = 0;
continue;
}
+ Owner->SetFailReason("ResolveFailure");
return _error->Error(_("Could not resolve '%s'"),Host.c_str());
}
diff --git a/methods/http.cc b/methods/http.cc
index deaa8d0c8..01ad14655 100644
--- a/methods/http.cc
+++ b/methods/http.cc
@@ -914,6 +914,9 @@ int HttpMethod::DealWithHeaders(FetchResult &Res,ServerState *Srv)
failure */
if (Srv->Result < 200 || Srv->Result >= 300)
{
+ char err[255];
+ snprintf(err,sizeof(err)-1,"HttpError%i",Srv->Result);
+ SetFailReason(err);
_error->Error("%u %s",Srv->Result,Srv->Code);
if (Srv->HaveContent == true)
return 4;
diff --git a/methods/mirror.cc b/methods/mirror.cc
index 8ccfb8559..b64879bec 100644
--- a/methods/mirror.cc
+++ b/methods/mirror.cc
@@ -31,20 +31,14 @@ using namespace std;
/*}}}*/
/* Done:
- * - works with http only
+ * - works with http (only!)
* - always picks the first mirror from the list
* - call out to problem reporting script
* - supports "deb mirror://host/path/to/mirror-list/// dist component"
+ * - use pkgAcqMethod::FailReason() to have a string representation
+ * of the failure that is also send to LP
*
* TODO:
- * what about gpgv failures? this should call-out to the problem reporting
- script, but we need to know what mirror was used -> just run pkgAcquire::Item::ReportMirrorFailure()
- * better standard format for errors to send back
- * - implement failure reporting at the pkgAcquire::Item::Failed() level
- but then we need to send back what uri exactly was failing
- [mvo: the problem with this approach is ::Failed() is not really
- called for all failures :/ e.g. md5sum mismatch in a archive
- is not]
* - deal with runing as non-root because we can't write to the lists
dir then -> use the cached mirror file
* - better method to download than having a pkgAcquire interface here