Skip to content

Commit

Permalink
Fix apache#1031, return RpcResult for validation exception to avoid r…
Browse files Browse the repository at this point in the history
…etry.
  • Loading branch information
chickenlj committed Jan 17, 2018
1 parent 235342e commit bade243
Showing 1 changed file with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand All @@ -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);
Expand Down

0 comments on commit bade243

Please sign in to comment.