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

Add option to deserialize the original exception types thrown by the RPC server #568

Merged
merged 2 commits into from
Sep 29, 2020

Conversation

AArnott
Copy link
Member

@AArnott AArnott commented Sep 29, 2020

This was already possible in v2.6 thanks to #505, but it required overriding virtual methods to take advantage of. Now it's as easy as setting a property on the JsonRpc instance.

Closes #468

@AArnott AArnott added this to the v2.7 milestone Sep 29, 2020
@AArnott AArnott self-assigned this Sep 29, 2020
@codecov-commenter
Copy link

codecov-commenter commented Sep 29, 2020

Codecov Report

Merging #568 into master will decrease coverage by 0.08%.
The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #568      +/-   ##
==========================================
- Coverage   90.00%   89.91%   -0.09%     
==========================================
  Files          54       54              
  Lines        4470     4481      +11     
==========================================
+ Hits         4023     4029       +6     
- Misses        447      452       +5     
Impacted Files Coverage Δ
...eamJsonRpc/Exceptions/RemoteInvocationException.cs 42.85% <100.00%> (+6.01%) ⬆️
src/StreamJsonRpc/JsonRpc.cs 92.85% <100.00%> (-0.29%) ⬇️
src/StreamJsonRpc/MessageHandlerBase.cs 98.79% <0.00%> (-1.21%) ⬇️
...pc/Reflection/MessageFormatterDuplexPipeTracker.cs 88.54% <0.00%> (-1.05%) ⬇️
src/StreamJsonRpc/JsonMessageFormatter.cs 91.36% <0.00%> (+0.01%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 1ef197f...c049c87. Read the comment docs.

Populate RemoteInvocationException.DeserializedErrorData with CommonErrorData even when we have the InnerException.
This lets existing JsonRpc users switch to ISerializable without breaking any existing code.
@AArnott AArnott merged commit dd31644 into microsoft:master Sep 29, 2020
@AArnott AArnott deleted the fix468 branch September 29, 2020 21:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Serialize exceptions with ISerializable pattern for error messages
3 participants