uber / tchannel-java

A Java implementation of the TChannel protocol.
MIT License
134 stars 67 forks source link

Propagate ErrorType to caller if ProtocolError is thrown by handler #197

Closed chornyi closed 5 years ago

chornyi commented 5 years ago

Allow clients to set the response ErrorType by throwing a ProtocolError. Rate limiting is one use-case where this is useful.

CLAassistant commented 5 years ago

CLA assistant check
All committers have signed the CLA.

codecov-io commented 5 years ago

Codecov Report

Merging #197 into master will increase coverage by 0.29%. The diff coverage is 100%.

Impacted file tree graph

@@             Coverage Diff              @@
##             master     #197      +/-   ##
============================================
+ Coverage     71.63%   71.92%   +0.29%     
  Complexity       10       10              
============================================
  Files            87       87              
  Lines          2654     2660       +6     
  Branches        318      320       +2     
============================================
+ Hits           1901     1913      +12     
+ Misses          535      525      -10     
- Partials        218      222       +4
Impacted Files Coverage Δ Complexity Δ
...java/com/uber/tchannel/handlers/RequestRouter.java 72.48% <100%> (-0.34%) 0 <0> (ø)
...rc/main/java/com/uber/tchannel/api/SubChannel.java 76.92% <0%> (-0.96%) 0% <0%> (ø)
.../main/java/com/uber/tchannel/errors/ErrorType.java 66.67% <0%> (+3.7%) 0% <0%> (ø) :arrow_down:
.../main/java/com/uber/tchannel/errors/BusyError.java 75% <0%> (+75%) 0% <0%> (ø) :arrow_down:
...n/java/com/uber/tchannel/errors/ProtocolError.java 100% <0%> (+100%) 0% <0%> (ø) :arrow_down:

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 f9cc9e2...8f2bc13. Read the comment docs.