summaryrefslogtreecommitdiffstats
path: root/vespaclient-core
diff options
context:
space:
mode:
authorHenning Baldersheim <balder@yahoo-inc.com>2018-02-05 14:27:09 +0100
committerHenning Baldersheim <balder@yahoo-inc.com>2018-02-05 14:31:21 +0100
commit2b1c0c4b415bf64a153083746ef31da06dcf9ccf (patch)
tree9f9c0a5d56998e42ca0d2a070f58a22139f80ff2 /vespaclient-core
parent50b28e226129546333db82b4c768241c39f6e5f9 (diff)
Add readability.
Diffstat (limited to 'vespaclient-core')
-rwxr-xr-xvespaclient-core/src/main/java/com/yahoo/feedhandler/FeedResponse.java12
1 files changed, 10 insertions, 2 deletions
diff --git a/vespaclient-core/src/main/java/com/yahoo/feedhandler/FeedResponse.java b/vespaclient-core/src/main/java/com/yahoo/feedhandler/FeedResponse.java
index 635659204e8..3b84f83fafa 100755
--- a/vespaclient-core/src/main/java/com/yahoo/feedhandler/FeedResponse.java
+++ b/vespaclient-core/src/main/java/com/yahoo/feedhandler/FeedResponse.java
@@ -172,14 +172,22 @@ public final class FeedResponse extends HttpResponse implements SharedSender.Res
// Like busy, no space etc.
if (error == DocumentProtocol.ERROR_NO_SPACE) {
return com.yahoo.container.protect.Error.INSUFFICIENT_STORAGE;
- } else if (error >= ErrorCode.TRANSIENT_ERROR && (error < ErrorCode.FATAL_ERROR)) {
+ } else if (isTransientError(error)) {
return com.yahoo.container.protect.Error.INTERNAL_SERVER_ERROR;
- } if (error >= ErrorCode.FATAL_ERROR && (error < ErrorCode.ERROR_LIMIT)) {
+ } if (isFatalError(error)) {
return com.yahoo.container.protect.Error.INTERNAL_SERVER_ERROR;
}
return com.yahoo.container.protect.Error.INTERNAL_SERVER_ERROR;
}
+ private static boolean isFatalError(int error) {
+ return (error >= ErrorCode.FATAL_ERROR) && (error < ErrorCode.ERROR_LIMIT);
+ }
+
+ private static boolean isTransientError(int error) {
+ return (error >= ErrorCode.TRANSIENT_ERROR) && (error < ErrorCode.FATAL_ERROR);
+ }
+
public boolean isSuccess() {
return errors.isEmpty();
}