Agree that sync and async counterparts for the same operation should through the same exception. Is it really not the case now? If not, we should fix it.
Disagree about ExecutionException, as the only reason it was done is to support checked exceptions. We have runtime exception, so we can throw the correct exception at all times. D. On Fri, Mar 20, 2015 at 5:32 AM, Sergey Evdokimov <[email protected]> wrote: > Hello, > > Failed cache operations throw CacheException, but failed asynchronous > operations throw IgniteException. I think it's wrong. Same synchronous and > asynchronous operation must throw same exception. > > BTW. According to contract of java.util.concurrent.Future#get() if result > of operation is an exception Future#get() should throw ExecutionException > that wrap result exception. We break this contract and throw result > exception directly from Future#get(), this may be cause of problems, for > example it's impossible to make out exceptions that threw during > computation and other runtime exceptions. > I propose to keep contract of Future#get() as described in JDK javadocs and > add our method "take" that throw exception directly as implemented at > Ignite currently. >
