diff --git a/src/Paket.Core/Dependencies/NuGet.fs b/src/Paket.Core/Dependencies/NuGet.fs index 76a9fd0245..18f457e9c8 100644 --- a/src/Paket.Core/Dependencies/NuGet.fs +++ b/src/Paket.Core/Dependencies/NuGet.fs @@ -276,7 +276,18 @@ let rec private getPackageDetails alternativeProjectRoot root force (parameters: traceWarnfn "I/O error for source '%O': %s" source exn.Message return! trySelectFirst (exn :> exn :: errors) rest | e -> - traceWarnfn "Source '%O' exception: %O" source e + let mutable information = "" + match e.GetBaseException() with + | :? RequestFailedException as re -> + match re.Info with + | Some requestinfo -> if requestinfo.StatusCode = HttpStatusCode.NotFound then + information <- re.Message + | None -> ignore() + | _ -> ignore() + if information <> "" then + traceWarnIfNotBefore (source, information) "Source '%O' exception: %O" source information + else + traceWarnfn "Source '%O' exception: %O" source e //let capture = ExceptionDispatchInfo.Capture e return! trySelectFirst (e :: errors) rest | [] -> return None, errors @@ -301,7 +312,7 @@ let rec private getPackageDetails alternativeProjectRoot root force (parameters: return! tryV3 nugetSource force with | exn -> - eprintfn "Possible Performance degradation, V3 was not working: %s" exn.Message + traceWarnfn "Possible Performance degradation, V3 was not working: %s" exn.Message if verbose then printfn "Error while using V3 API: %O" exn diff --git a/src/Paket.Core/Dependencies/NuGetCache.fs b/src/Paket.Core/Dependencies/NuGetCache.fs index 0c70150397..89e68aa1af 100644 --- a/src/Paket.Core/Dependencies/NuGetCache.fs +++ b/src/Paket.Core/Dependencies/NuGetCache.fs @@ -524,7 +524,7 @@ let tryAndBlacklistUrl doBlackList doWarn (source:NugetSource) (tryAgain : 'a -> let! (isOk, res) = task |> Async.AwaitTask if not isOk then if doWarn then - eprintfn "Possible Performance degradation, blacklist '%s'" url.InstanceUrl + traceWarnIfNotBefore url.InstanceUrl "Possible Performance degradation, blacklist '%s'" url.InstanceUrl return Choice2Of3 res else return Choice1Of3 res diff --git a/src/Paket.Core/Dependencies/NuGetV2.fs b/src/Paket.Core/Dependencies/NuGetV2.fs index 7eba453a6f..10692821bd 100644 --- a/src/Paket.Core/Dependencies/NuGetV2.fs +++ b/src/Paket.Core/Dependencies/NuGetV2.fs @@ -98,7 +98,7 @@ let tryGetAllVersionsFromNugetODataWithFilter (auth, nugetURL, package:PackageNa match tryGetAllVersionsFromNugetODataWithFilterWarnings.TryGetValue nugetURL with | true, true -> () | _, _ -> - eprintfn "Possible Performance degradation, could not retrieve '%s', ignoring further warnings for this source" url + traceWarnfn "Possible Performance degradation, could not retrieve '%s', ignoring further warnings for this source" url tryGetAllVersionsFromNugetODataWithFilterWarnings.TryAdd(nugetURL, true) |> ignore if verbose then printfn "Error while retrieving data from '%s': %O" url exn diff --git a/src/Paket.Core/Dependencies/NuGetV3.fs b/src/Paket.Core/Dependencies/NuGetV3.fs index 8abe46db6b..b574da7bc0 100644 --- a/src/Paket.Core/Dependencies/NuGetV3.fs +++ b/src/Paket.Core/Dependencies/NuGetV3.fs @@ -478,9 +478,9 @@ let loadFromCacheOrGetDetails (force:bool) return false,ODataSearchResult.Match cachedObject with exn -> if verboseWarnings then - eprintfn "Possible Performance degradation, could not retrieve '%O' from cache: %O" packageName exn + traceWarnfn "Possible Performance degradation, could not retrieve '%O' from cache: %O" packageName exn else - eprintfn "Possible Performance degradation, could not retrieve '%O' from cache: %s" packageName exn.Message + traceWarnIfNotBefore ("NuGetV3 n/a", packageName, exn.Message) "Possible Performance degradation, could not retrieve '%O' from cache: %s" packageName exn.Message let! details = getPackageDetails source packageName version return true,details else