Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Trace not-found and blacklist warnings as actual warnings #2997

Merged
merged 1 commit into from
Jan 18, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 13 additions & 2 deletions src/Paket.Core/Dependencies/NuGet.fs
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

/cc @matthid good idea?

if verbose then
printfn "Error while using V3 API: %O" exn

Expand Down
2 changes: 1 addition & 1 deletion src/Paket.Core/Dependencies/NuGetCache.fs
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion src/Paket.Core/Dependencies/NuGetV2.fs
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions src/Paket.Core/Dependencies/NuGetV3.fs
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down