-
Notifications
You must be signed in to change notification settings - Fork 782
Return 0 status code on exception or invalid code #1387
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
Conversation
@@ -395,7 +395,17 @@ public String requestHeader(ClientRequest request, String name) { | |||
|
|||
@Override | |||
public Integer statusCode(ClientResponse response) { | |||
return response.statusCode().value(); | |||
return response.rawStatusCode(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
something like this otherwise you still end up with the exception :P
@Override public Integer statusCode(HttpResponse response) {
int result = statusCodeAsInt(response);
return result != 0 ? result : null;
}
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok but statusCode
is called only via the statusCodeAsInt
in Brave
Codecov Report
@@ Coverage Diff @@
## 2.1.x #1387 +/- ##
===========================================
+ Coverage 66.78% 67% +0.22%
Complexity 850 850
===========================================
Files 145 145
Lines 4028 4031 +3
Branches 422 422
===========================================
+ Hits 2690 2701 +11
+ Misses 1099 1090 -9
- Partials 239 240 +1
Continue to review full report at Codecov.
|
Codecov Report
@@ Coverage Diff @@
## 2.1.x #1387 +/- ##
============================================
- Coverage 66.78% 66.61% -0.17%
Complexity 850 850
============================================
Files 145 145
Lines 4028 4032 +4
Branches 422 423 +1
============================================
- Hits 2690 2686 -4
- Misses 1099 1108 +9
+ Partials 239 238 -1
Continue to review full report at Codecov.
|
Eventhough new instrumentation don't use it, old could. See spring-cloud/spring-cloud-sleuth#1387
fixes gh-1382