-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Switch to System.Formats.Nrbf #11745
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
Conversation
… all, simply the SerializationRecord from System.Formats.Nrbf
…parsing and deserialization (not needed anymore)
| { | ||
| return NrbfDecoder.Decode(stream, leaveOpen: true); | ||
| } | ||
| catch (Exception ex) when(ex is ArgumentException or InvalidCastException or ArithmeticException or IOException) |
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.
Here I wanted to keep the same exception handling:
Lines 69 to 77 in 8b0150c
| catch (Exception ex) when (ex is ArgumentException or InvalidCastException or ArithmeticException or IOException) | |
| { | |
| // Make the exception easier to catch, but retain the original stack trace. | |
| throw ex.ConvertToSerializationException(); | |
| } | |
| catch (TargetInvocationException ex) | |
| { | |
| throw ExceptionDispatchInfo.Capture(ex.InnerException!).SourceException.ConvertToSerializationException(); | |
| } |
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #11745 +/- ##
===================================================
+ Coverage 74.69499% 74.79155% +0.09655%
===================================================
Files 3045 3021 -24
Lines 630638 629289 -1349
Branches 46862 46689 -173
===================================================
- Hits 471055 470655 -400
+ Misses 156224 155274 -950
- Partials 3359 3360 +1
Flags with carried forward coverage won't be shown. Click here to find out more. |
JeremyKuhne
left a comment
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.
Thanks for updating this!
In the first commit (7db91c1), I've introduced a set of extensions that don't use
BinaryFormattedObjectat all, just theSerializationRecordfrom System.Formats.Nrbf.Then I've realized that
BinaryFormattedObject.Deserializeis not used by the product anymore, so I've removed it and everything related to parsing. All I kept is the writing logic and its tests.This was possible because the deserializer that @JeremyKuhne has authored was moved to dotnet/runtime in dotnet/runtime#102379.
Microsoft Reviewers: Open in CodeFlow