Return 0 status code on exception or invalid code#1387
Return 0 status code on exception or invalid code#1387marcingrzejszczak merged 2 commits into2.1.xfrom
Conversation
| @Override | ||
| public Integer statusCode(ClientResponse response) { | ||
| return response.statusCode().value(); | ||
| return response.rawStatusCode(); |
There was a problem hiding this comment.
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.
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