-
Notifications
You must be signed in to change notification settings - Fork 803
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
TypeProviders: Add inner base-exception description #17251
Conversation
❗ Release notes required
|
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.
Great stuff! A few nits, nothing major. It would be nice if there were test cases for this... (but imo no need to add them now).
Thanks @abelbraaksma Co-authored-by: Abel Braaksma <abel.online@xs4all.nl>
Co-authored-by: Abel Braaksma <abel.online@xs4all.nl>
@Thorium About this comment: #17251 (comment) I just realize that Which means, in turn, that your code is not safe currently for the same reasons you stated. I propose to get around this as follows, just add a function like the following, and use that instead: [<TailCall>]
let rec getMostInnerException (ex: exn) =
if isNull ex then
// should never happen, we are in a try-with (we may consider throwing instead of returning?)
ArgumentNullException("Unreachable code. Caught exception is null", nameof ex) :> exn
else
if isNull ex.InnerException then ex
else getMostInnerException ex.InnerException Oh, and @smoothdeveloper had a #17251 (comment) that got buried a bit. to his point, I'd argue that the current change is already an improvement, but showing the entire stacktrace in the tooltip blob can easily take the whole screen and be disruptive. While I agree that it is useful, we may want to think about that a little first. |
No the ex it's not null itself, but the inner one is. |
@Thorium Yes, but that won't change how My point was more about a user-overridden |
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.
My previous trains of thought may have been confusing, in part because I wasn't entirely correct. It is subtle. Please check my new comments, I think only the changes in line 108 are actually needed.
Anything blocking this PR ? Looks a good improvement when working with TP cc @psfinaki |
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.
@Thorium, thanks for taking the time to address my suggestions and patiently explaining your approach and choices.
I think one day we have to revisit e.GetBaseException()
, as it skips over any and all exceptions between top and bottom, and I originally thought your PR was about getting the first inner exception of the tree. But that doesn't have to be addressed now.
Be as it may, I never meant to block this, but real life caught up and I wasn't notified anymore, until @psfinaki reminded me.
Let's get this in. I think it is a great improvement over what we had originally.
/azp run |
Azure Pipelines successfully started running 2 pipeline(s). |
As @smoothdeveloper PR #4978 from 2018 is still not not accepted,
this tries to be the simplest possible fix for the existing issue #17249