-
Notifications
You must be signed in to change notification settings - Fork 525
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
Improve error reporting #2423
Improve error reporting #2423
Conversation
…out (to get an idea what the process was doing).
…via AggregateException.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's see what the CI says.
static member Choice(tasks : Async<'T option> seq) = async { | ||
static member map f a = | ||
async { return f a } | ||
static member tryFind (f : 'T -> bool) (tasks : Async<'T> seq) = async { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is an interesting API.
It is almost like Async.Choice
, but will return all the started tasks and an index which one matched the given function.
@@ -560,7 +555,7 @@ let downloadFromUrl (auth:Auth option, url : string) (filePath: string) = | |||
do! task | |||
with | |||
| exn -> | |||
failwithf "Could not download from %s%s Message: %s%s" url Environment.NewLine exn.Message (innerText exn) | |||
raise <| Exception(sprintf "Could not download from '%s'" url, exn) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We almost never should do failwithf
in a general with exn ->
clause, not even when we embed the message (like here)...
I really think F# should make this more easy (with some syntax), even the F# compiler is doing it wrong everywhere
/cc @dsyme any ideas?
maybe allowing to use comma in combination with failwithf "some message", innerException
@@ -612,11 +606,12 @@ let safeGetFromUrl (auth:Auth option, url : string, contentType : string) = | |||
#endif | |||
use _ = Profile.startCategory Profile.Category.NuGetRequest | |||
let! raw = client.DownloadStringTaskAsync(uri) |> Async.AwaitTask | |||
return Some raw | |||
return FSharp.Core.Result.Ok raw |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe I should use full-out exceptions everywhere :/
This is how a failure looks now:
These changes also show that the random failure we get sometimes is apparently another mono bug:
|
https://github.com/mono/boringssl/blob/mono/ssl/s3_both.c#L363 https://github.com/mono/boringssl/blob/mono/ssl/s3_both.c#L291
Nice |
Note that
Is explained by the mono bug as well: |
…ed by the structure)
There are so many more places where |
…es in the final exception print (might be useful for single tests or to tell people to get better bug reports).
is this ready? |
thx! |
This improves output and internal error propagation in the NuGet-RequestVersions code.
The goal is to output in the error case which urls where requested and what reponse we got from them...
For now this is WIP, because I think there might be some cases now where we print way too much info (in the non-verbose case).