-
-
Notifications
You must be signed in to change notification settings - Fork 210
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
Avoid Unhandled Exception on .NET 461 if the Registry Access threw an exception. #1101
Conversation
Codecov Report
@@ Coverage Diff @@
## main #1101 +/- ##
==========================================
+ Coverage 80.72% 80.77% +0.05%
==========================================
Files 194 195 +1
Lines 6359 6414 +55
Branches 1411 1416 +5
==========================================
+ Hits 5133 5181 +48
- Misses 764 771 +7
Partials 462 462
Continue to review full report at Codecov.
|
Co-authored-by: Alexey Golub <tyrrrrrr@gmail.com>
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.
Looks good 👍
src/Sentry/PlatformAbstractions/NetFxInstallationsEventProcessor.cs
Outdated
Show resolved
Hide resolved
Ok, error flow has changed:
|
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.
Looks good! Some visual nits
Co-authored-by: Alexey Golub <tyrrrrrr@gmail.com>
…getsentry/sentry-dotnet into feat/opt-out-netfxinstalaltions
Co-authored-by: Bruno Garcia <bruno@brunogarcia.com>
…getsentry/sentry-dotnet into feat/opt-out-netfxinstalaltions
…getsentry/sentry-dotnet into feat/opt-out-netfxinstalaltions
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.
I have a couple of nits but otherwise LGTM
Co-authored-by: Bruno Garcia <bruno@brunogarcia.com>
SentryOptions .Ctor calls Runtime.Current.Name and that parameter was unsafe since it calls SetNetFxReleaseAndVersion on NET461.
Where, inside of it, is called RegistryKey.OpenBaseKey, which may throw an Exception by executing it.
The goal of this PR is to block any access to the functions that rely on RegistryKey in case of failure, avoiding unhandled exceptions to the user.
My only question is what to do in case of an exception inside of GetLatest? it would be nice to log the error but we don't have access to SentryOptions from it.
Close #969
#skip-changelog