Allow for null values in ExtractingResponseErrorHandler.hasError

This commit fixes the implementation of
ExtractingResponseErrorHandler.hasError to allow for null values,
indicating an override of the behavior inherited from
DefaultResponseErrorHandler.

Issue: SPR-15544
This commit is contained in:
Arjen Poutsma
2017-06-01 11:44:08 +02:00
parent d3e3365990
commit 7894efdd1e
2 changed files with 25 additions and 3 deletions

View File

@@ -126,9 +126,15 @@ public class ExtractingResponseErrorHandler extends DefaultResponseErrorHandler
@Override
protected boolean hasError(HttpStatus statusCode) {
return this.statusMapping.containsKey(statusCode) ||
this.seriesMapping.containsKey(statusCode.series()) ||
super.hasError(statusCode);
if (this.statusMapping.containsKey(statusCode)) {
return this.statusMapping.get(statusCode) != null;
}
else if (this.seriesMapping.containsKey(statusCode.series())) {
return this.seriesMapping.get(statusCode.series()) != null;
}
else {
return super.hasError(statusCode);
}
}
@Override