summaryrefslogtreecommitdiffstats
path: root/vespaclient-container-plugin
diff options
context:
space:
mode:
authorBjørn Christian Seime <bjorncs@yahooinc.com>2023-03-02 13:23:55 +0100
committerBjørn Christian Seime <bjorncs@yahooinc.com>2023-03-02 13:23:55 +0100
commitf06173d2ad91349e3d4831127641f4f0306c19b9 (patch)
tree6249eb4835516ea37a7904dbfa4f2a85ee0069db /vespaclient-container-plugin
parent69189de8d243192ae82f99fa636eb7969602cea5 (diff)
Make proper constant
Diffstat (limited to 'vespaclient-container-plugin')
-rw-r--r--vespaclient-container-plugin/src/main/java/com/yahoo/vespa/http/server/ErrorCode.java20
1 files changed, 11 insertions, 9 deletions
diff --git a/vespaclient-container-plugin/src/main/java/com/yahoo/vespa/http/server/ErrorCode.java b/vespaclient-container-plugin/src/main/java/com/yahoo/vespa/http/server/ErrorCode.java
index ed506c77631..90c6ffd042d 100644
--- a/vespaclient-container-plugin/src/main/java/com/yahoo/vespa/http/server/ErrorCode.java
+++ b/vespaclient-container-plugin/src/main/java/com/yahoo/vespa/http/server/ErrorCode.java
@@ -19,6 +19,15 @@ enum ErrorCode {
TRANSIENT_ERROR(false, true),
END_OF_FEED(true, true);
+ private static final Collection<Integer> MBUS_FATALS_HANDLED_AS_TRANSIENT = Set.of(
+ com.yahoo.messagebus.ErrorCode.SEND_QUEUE_CLOSED,
+ com.yahoo.messagebus.ErrorCode.ILLEGAL_ROUTE,
+ com.yahoo.messagebus.ErrorCode.NO_SERVICES_FOR_ROUTE,
+ com.yahoo.messagebus.ErrorCode.NETWORK_ERROR,
+ com.yahoo.messagebus.ErrorCode.SEQUENCE_ERROR,
+ com.yahoo.messagebus.ErrorCode.NETWORK_SHUTDOWN,
+ com.yahoo.messagebus.ErrorCode.TIMEOUT);
+
private final boolean success;
private final boolean _transient;
@@ -36,15 +45,8 @@ enum ErrorCode {
}
static ErrorCode fromBusError(Error mbusError) {
- Collection<Integer> fatalsHandledAsTransient = Set.of(
- com.yahoo.messagebus.ErrorCode.SEND_QUEUE_CLOSED,
- com.yahoo.messagebus.ErrorCode.ILLEGAL_ROUTE,
- com.yahoo.messagebus.ErrorCode.NO_SERVICES_FOR_ROUTE,
- com.yahoo.messagebus.ErrorCode.NETWORK_ERROR,
- com.yahoo.messagebus.ErrorCode.SEQUENCE_ERROR,
- com.yahoo.messagebus.ErrorCode.NETWORK_SHUTDOWN,
- com.yahoo.messagebus.ErrorCode.TIMEOUT);
- return mbusError.isFatal() && !fatalsHandledAsTransient.contains(mbusError.getCode()) ? ERROR : TRANSIENT_ERROR;
+ return mbusError.isFatal() && !MBUS_FATALS_HANDLED_AS_TRANSIENT.contains(mbusError.getCode())
+ ? ERROR : TRANSIENT_ERROR;
}
}