From bade24329b3b04cfa36ace0f2045eea4ed55eb53 Mon Sep 17 00:00:00 2001 From: "ken.lj" Date: Wed, 17 Jan 2018 18:04:51 +0800 Subject: [PATCH] Fix #1031, return RpcResult for validation exception to avoid retry. --- .../com/alibaba/dubbo/validation/filter/ValidationFilter.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/dubbo-filter/dubbo-filter-validation/src/main/java/com/alibaba/dubbo/validation/filter/ValidationFilter.java b/dubbo-filter/dubbo-filter-validation/src/main/java/com/alibaba/dubbo/validation/filter/ValidationFilter.java index 655aad878f9..d26d01888db 100644 --- a/dubbo-filter/dubbo-filter-validation/src/main/java/com/alibaba/dubbo/validation/filter/ValidationFilter.java +++ b/dubbo-filter/dubbo-filter-validation/src/main/java/com/alibaba/dubbo/validation/filter/ValidationFilter.java @@ -24,6 +24,7 @@ import com.alibaba.dubbo.rpc.Invoker; import com.alibaba.dubbo.rpc.Result; import com.alibaba.dubbo.rpc.RpcException; +import com.alibaba.dubbo.rpc.RpcResult; import com.alibaba.dubbo.validation.Validation; import com.alibaba.dubbo.validation.Validator; @@ -50,7 +51,7 @@ public Result invoke(Invoker invoker, Invocation invocation) throws RpcExcept } catch (RpcException e) { throw e; } catch (Throwable t) { - throw new RpcException(t.getMessage(), t); + return new RpcResult(t); } } return invoker.invoke(invocation);