diff options
Diffstat (limited to 'vespa-http-client/src/main/java/com/yahoo/vespa/http/client/core/operationProcessor/EndPointResultFactory.java')
-rw-r--r-- | vespa-http-client/src/main/java/com/yahoo/vespa/http/client/core/operationProcessor/EndPointResultFactory.java | 28 |
1 files changed, 13 insertions, 15 deletions
diff --git a/vespa-http-client/src/main/java/com/yahoo/vespa/http/client/core/operationProcessor/EndPointResultFactory.java b/vespa-http-client/src/main/java/com/yahoo/vespa/http/client/core/operationProcessor/EndPointResultFactory.java index 95df465c7ca..205153a7a00 100644 --- a/vespa-http-client/src/main/java/com/yahoo/vespa/http/client/core/operationProcessor/EndPointResultFactory.java +++ b/vespa-http-client/src/main/java/com/yahoo/vespa/http/client/core/operationProcessor/EndPointResultFactory.java @@ -38,30 +38,28 @@ public final class EndPointResultFactory { return results; } - public static EndpointResult createError( - Endpoint endpoint, String operationId, Exception exception) { - return new EndpointResult(operationId, new Result.Detail( - endpoint, Result.ResultType.FATAL_ERROR, null, exception)); + public static EndpointResult createError(Endpoint endpoint, String operationId, Exception exception) { + return new EndpointResult(operationId, new Result.Detail(endpoint, + Result.ResultType.FATAL_ERROR, + null, + exception)); } - public static EndpointResult createTransientError( - Endpoint endpoint, String operationId, Exception exception) { - return new EndpointResult(operationId, new Result.Detail( - endpoint, Result.ResultType.TRANSITIVE_ERROR, null, exception)); + public static EndpointResult createTransientError(Endpoint endpoint, String operationId, Exception exception) { + return new EndpointResult(operationId, new Result.Detail(endpoint, + Result.ResultType.TRANSITIVE_ERROR, + null, + exception)); } private static Result.ResultType replyToResultType(OperationStatus reply) { - final Result.ResultType resultType; // The ordering below is important, e.g. if success, it is never a transient error even if isTransient is true. - if (reply.errorCode.isSuccess()) { + if (reply.errorCode.isSuccess()) return Result.ResultType.OPERATION_EXECUTED; - } - if (reply.isConditionNotMet) { + if (reply.isConditionNotMet) return Result.ResultType.CONDITION_NOT_MET; - } - if (reply.errorCode.isTransient()) { + if (reply.errorCode.isTransient()) return Result.ResultType.TRANSITIVE_ERROR; - } return Result.ResultType.FATAL_ERROR; } |