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

Promote error info into RemoteRpcException #554

Merged
merged 1 commit into from
Sep 18, 2020

Conversation

AArnott
Copy link
Member

@AArnott AArnott commented Sep 18, 2020

Some of this error info was unique to RemoteInvocationException but some was replicated across RemoteMethodNotFoundException as well. In fact, most RPC error exceptions should include an error code, so promoting these to the base class makes sense.
But not all RemoteRpcException derived types come from a JSON-RPC error, so we must allow for not having an error code.
We also need to be creative to avoid any backward breaking API changes. So instead of moving the properties to the base class, I add them to the base class and 'redefine' them in the derived types to simply forward the value from the base class.

Some of this error info was unique to `RemoteInvocationException` but some was replicated across `RemoteMethodNotFoundException` as well. In fact, most RPC error exceptions should include an error code, so promoting these to the base class makes sense.
But not *all* `RemoteRpcException` derived types come from a JSON-RPC error, so we must allow for not having an error code.
We also need to be creative to avoid any backward breaking API changes. So instead of *moving* the properties to the base class, I add them to the base class and 'redefine' them in the derived types to simply forward the value from the base class.
@codecov-commenter
Copy link

codecov-commenter commented Sep 18, 2020

Codecov Report

Merging #554 into master will decrease coverage by 0.09%.
The diff coverage is 95.65%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #554      +/-   ##
==========================================
- Coverage   89.92%   89.83%   -0.10%     
==========================================
  Files          54       54              
  Lines        4438     4445       +7     
==========================================
+ Hits         3991     3993       +2     
- Misses        447      452       +5     
Impacted Files Coverage Δ
...sonRpc/Exceptions/RemoteMethodNotFoundException.cs 52.94% <83.33%> (ø)
...eamJsonRpc/Exceptions/RemoteInvocationException.cs 36.84% <100.00%> (-6.02%) ⬇️
src/StreamJsonRpc/Exceptions/RemoteRpcException.cs 100.00% <100.00%> (ø)
src/StreamJsonRpc/JsonRpc.cs 92.71% <0.00%> (-0.65%) ⬇️
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 3e873ba...81ee686. Read the comment docs.

@AArnott AArnott merged commit 924b89d into microsoft:master Sep 18, 2020
@AArnott AArnott deleted the exceptionApiWork branch September 18, 2020 18:08
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