Hey David, If you use the synchronous RiakCommand.execute method and it errors out, then the method will returned a checked ExecutionException wrapping the original exception ( https://github.com/basho/riak-java-client/blob/develop/src/main/java/com/basho/riak/client/api/RiakCommand.java#L85), which matches the olde style of Java programming.
The async/futures style only throws that issue if you get an error and then call get() without checking the isSuccess() method / cause field first. ( https://github.com/basho/riak-java-client/blob/develop/src/main/java/com/basho/riak/client/core/RiakFuture.java#L86-L87 ) So we could maybe use some better docs on the RiakCommand:execute method, but it all works as intended :-) Thanks, Alex On Fri, Nov 13, 2015 at 8:05 PM, David Byron <dby...@dbyron.com> wrote: > From my reading of RiakCommand#execute ( > https://github.com/basho/riak-java-client/blob/develop/src/main/java/com/basho/riak/client/api/RiakCommand.java#L85), > I'm curious why there's no call to > > future.isSuccess() > > I can imagine that future.await() throws an exception for all possible > failures, but then the docs for RiakFuture ( > https://github.com/basho/riak-java-client/blob/develop/src/main/java/com/basho/riak/client/core/RiakFuture.java#L60) > say: > > The typical use pattern is to call await(), check isSuccess(), then call > getNow() or cause(). > > Maybe all I'm looking for is a comment in RiakCommand#execute explaining > why it's not the typical use pattern...but my paranoid self is nervous at > the moment. > > Thanks for helping me understand. > > -DB > > _______________________________________________ > riak-users mailing list > riak-users@lists.basho.com > http://lists.basho.com/mailman/listinfo/riak-users_lists.basho.com >
_______________________________________________ riak-users mailing list riak-users@lists.basho.com http://lists.basho.com/mailman/listinfo/riak-users_lists.basho.com