- // set some status
- if(LookupTag(Message,"FailReason") == "Timeout" ||
- LookupTag(Message,"FailReason") == "TmpResolveFailure" ||
- LookupTag(Message,"FailReason") == "ResolveFailure" ||
- LookupTag(Message,"FailReason") == "ConnectionRefused")
- (*O)->Status = pkgAcquire::Item::StatTransientNetworkError;
-
- (*O)->Failed(Message,Config);
+ std::string const failReason = LookupTag(Message, "FailReason");
+ {
+ auto const reasons = { "Timeout", "ConnectionRefused",
+ "ConnectionTimedOut", "ResolveFailure", "TmpResolveFailure" };
+ errTransient = std::find(std::begin(reasons), std::end(reasons), failReason) != std::end(reasons);
+ }
+ if (errTransient == false)
+ {
+ auto const reasons = { "HashSumMismatch", "WeakHashSums", "MaximumSizeExceeded" };
+ errAuthErr = std::find(std::begin(reasons), std::end(reasons), failReason) != std::end(reasons);
+ }
+ }