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

Tighten up exceptions thrown by formatters #539

Merged
5 commits merged into from
Sep 3, 2020

Conversation

AArnott
Copy link
Member

@AArnott AArnott commented Sep 2, 2020

Wrap any/all exceptions thrown by formatters in the exception type native to their serializer.

This PR builds on #538, so until that completes, the diff on this PR will look larger than its one unique commit.

Everything checks out, but this resolves a concern brought up in microsoft#246
- `ConnectionLostException` is thrown when the connection drops (due to local Dispose call) on a pending outbound call.
- `OperationCanceledException` is thrown in the prior scenario but when the outbound call's `CancellationToken` is signaled.
- An RPC server in an callback will itself experience `OperationCanceledException` instead of `ConnectionLostException` if the client disconnects.
@AArnott AArnott added this to the v2.6 milestone Sep 2, 2020
@AArnott AArnott requested review from tmat and milopezc September 2, 2020 22:07
@AArnott AArnott self-assigned this Sep 2, 2020
@AArnott AArnott marked this pull request as ready for review September 2, 2020 22:07
@codecov-commenter
Copy link

codecov-commenter commented Sep 2, 2020

Codecov Report

Merging #539 into master will decrease coverage by 0.02%.
The diff coverage is 94.73%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #539      +/-   ##
==========================================
- Coverage   89.76%   89.74%   -0.03%     
==========================================
  Files          53       53              
  Lines        4408     4418      +10     
==========================================
+ Hits         3957     3965       +8     
- Misses        451      453       +2     
Impacted Files Coverage Δ
src/StreamJsonRpc/JsonRpc.cs 92.48% <ø> (-0.32%) ⬇️
src/StreamJsonRpc/JsonMessageFormatter.cs 91.27% <92.30%> (+0.10%) ⬆️
src/StreamJsonRpc/MessagePackFormatter.cs 91.72% <100.00%> (+0.03%) ⬆️
src/StreamJsonRpc/Resources.Designer.cs 70.27% <100.00%> (+0.40%) ⬆️
src/StreamJsonRpc/MessageHandlerBase.cs 100.00% <0.00%> (+1.21%) ⬆️

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 e2579f9...de5cc5e. Read the comment docs.

@ghost ghost merged commit 2d412ae into microsoft:master Sep 3, 2020
@AArnott AArnott deleted the fix246_formatterExceptions branch September 3, 2020 00:07
This pull request was closed.
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.

3 participants