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

Improves exception rendering for async methods in .NET 6 #718

Merged

Conversation

phil-scott-78
Copy link
Contributor

@phil-scott-78 phil-scott-78 commented Feb 3, 2022

.NET 6 includes a new attribute that makes it easy to filter out stack frames we don't want to include. We can also improve upon the name of the method displayed when working with async calls.

Before

before

After

after

Fallback

Previous versions of .NET without the attribute still work and have better method names with async calls, but the additional stack frames are still included
image

@0xced
Copy link
Contributor

0xced commented Feb 3, 2022

Nice improvement, but this is going to conflict hard with #695. 😦

@phil-scott-78
Copy link
Contributor Author

Totally missed that PR. I suspect it wouldn't be terribly difficult for me to redo things to make it work on top of it, but I'd have to move a lot of the processing logic a lot closer to the rendering if I don't have the extra classes to smuggle the parsed data around.

Then again, it's not like we have a ton of use for the parsed data elsewhere so that might actually end up being a slightly cleaner solution altogether

@phil-scott-78
Copy link
Contributor Author

Ok, I looked at @0xced PR and building this on top of it I think it's the way to go.

@patriksvensson and @nils-a if you all don't have any objections, I'm going to merge it and redo this PR on top of it.

@patriksvensson
Copy link
Contributor

@phil-scott-78 No objections from me!

@phil-scott-78
Copy link
Contributor Author

Great. I've merged the other PR and I'll redo this one!

Thanks for the heads up @0xced

@phil-scott-78
Copy link
Contributor Author

ok, redid this on top of @0xced work. Thanks again for the heads up. I quite like how they both came together.

Copy link
Contributor

@patriksvensson patriksvensson left a comment

Choose a reason for hiding this comment

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

LGTM!

@patriksvensson patriksvensson merged commit a0e20f2 into spectreconsole:main Feb 3, 2022
@phil-scott-78 phil-scott-78 deleted the modern-stacktrace branch February 15, 2022 01:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants