-
Notifications
You must be signed in to change notification settings - Fork 225
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
restore reason string behaviour pre 0.18 #539
Conversation
Before 0.18.0 the reason string for an RPC error did not interpolate the kind inside. This makes sense because the type already has its own attribute. This patch restores the original behaviour so that clients that rely on inspecting this error string can continue to operate as before.
For reference, here's the commit where the change happened: 13ccb48. |
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## master #539 +/- ##
==========================================
+ Coverage 51.64% 52.38% +0.73%
==========================================
Files 69 70 +1
Lines 33735 34578 +843
==========================================
+ Hits 17422 18113 +691
- Misses 16313 16465 +152 ☔ View full report in Codecov by Sentry. |
@ariel-miculas, this pull request is proposing to revert one detail of your commit 13ccb48. Do you care to weigh in? Any reason that I shouldn't accept this change? |
OK, I reminded myself what's going on here.
capnp-v0.18 added a bunch of variants to the capnproto-rust/capnp/src/lib.rs Lines 180 to 395 in 1ec4709
However, the RPC capnproto-rust/capnp-rpc/schema/rpc.capnp Lines 1198 to 1246 in 1ec4709
The Note that in the base Anyways -- I am aware that the mismatch between these error types is not ideal, and I would like to figure out a way to make it nicer. |
I think it makes sense. The case I had issues with were exceptions of type Failed, and with the linked change I have complete control over the reason string. |
Closing in favor of #540. |
Before 0.18.0 the reason string for an RPC error did not interpolate the kind inside. This makes sense because the type already has its own attribute.
This patch restores the original behaviour so that clients that rely on inspecting this error string can continue to operate as before.