Quantcast

[infinispan-dev] Unwrapping exceptions

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

[infinispan-dev] Unwrapping exceptions

Katia Aresti
Hi all !

Radim pointed me to this thread discussing the exceptions launched by the lambda executed by the user.

So, I've came accros this problem right now with the compute method.

ComputeIfAbsent is used by the QueryCache [1]

This method is now a Command, so when the wrapped lambda throws an exception, [2], the expected exception is the one raised by the lambda. But with my modifications, this exception is wrapped in a CacheException.

I discussed with Adrien yesterday, and IMHO and his, a CacheException is not the same thing as the exception raised inside the lambda. Moreover, in this particular case, I don't know if users some code could be broken if we make the user get a CacheException that wrappes the ParseException instead of the ParseException itself. 

How can I fix the problem ? 
Should we correct the tests and say that, from now on, CacheException will be raised ?
Should we handle this CacheException in the QueryCache class when computeIfAbsent is called ?
Should we propagate the lambda's exception as it is ?

Katia



_______________________________________________
infinispan-dev mailing list
[hidden email]
https://lists.jboss.org/mailman/listinfo/infinispan-dev
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: [infinispan-dev] Unwrapping exceptions

Sanne Grinovero-3
Personally as a user I'd expect to have a CacheException raised if and
only if it's not caused by my own code.

Imagine my own lambda is explicitly throwing an exception of a type of
my choice, it would be nice to receive that error and not a different
one.

On 28 April 2017 at 11:38, Katia Aresti <[hidden email]> wrote:

> Hi all !
>
> Radim pointed me to this thread discussing the exceptions launched by the
> lambda executed by the user.
>
> So, I've came accros this problem right now with the compute method.
>
> ComputeIfAbsent is used by the QueryCache [1]
>
> This method is now a Command, so when the wrapped lambda throws an
> exception, [2], the expected exception is the one raised by the lambda. But
> with my modifications, this exception is wrapped in a CacheException.
>
> I discussed with Adrien yesterday, and IMHO and his, a CacheException is not
> the same thing as the exception raised inside the lambda. Moreover, in this
> particular case, I don't know if users some code could be broken if we make
> the user get a CacheException that wrappes the ParseException instead of the
> ParseException itself.
>
> How can I fix the problem ?
> Should we correct the tests and say that, from now on, CacheException will
> be raised ?
> Should we handle this CacheException in the QueryCache class when
> computeIfAbsent is called ?
> Should we propagate the lambda's exception as it is ?
>
> Katia
>
> [1]
> https://github.com/infinispan/infinispan/blob/master/query/src/main/java/org/infinispan/query/dsl/embedded/impl/QueryCache.java#L79
> [2]
> https://github.com/infinispan/infinispan/blob/master/query/src/test/java/org/infinispan/query/dsl/embedded/QueryDslConditionsTest.java#L1913
>
>
> _______________________________________________
> infinispan-dev mailing list
> [hidden email]
> https://lists.jboss.org/mailman/listinfo/infinispan-dev
_______________________________________________
infinispan-dev mailing list
[hidden email]
https://lists.jboss.org/mailman/listinfo/infinispan-dev
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: [infinispan-dev] Unwrapping exceptions

Wolf Fink
+1 for Sanne
I would expect the same and I suppose one or more customers will raise this issue

On Fri, Apr 28, 2017 at 12:56 PM, Sanne Grinovero <[hidden email]> wrote:
Personally as a user I'd expect to have a CacheException raised if and
only if it's not caused by my own code.

Imagine my own lambda is explicitly throwing an exception of a type of
my choice, it would be nice to receive that error and not a different
one.

On 28 April 2017 at 11:38, Katia Aresti <[hidden email]> wrote:
> Hi all !
>
> Radim pointed me to this thread discussing the exceptions launched by the
> lambda executed by the user.
>
> So, I've came accros this problem right now with the compute method.
>
> ComputeIfAbsent is used by the QueryCache [1]
>
> This method is now a Command, so when the wrapped lambda throws an
> exception, [2], the expected exception is the one raised by the lambda. But
> with my modifications, this exception is wrapped in a CacheException.
>
> I discussed with Adrien yesterday, and IMHO and his, a CacheException is not
> the same thing as the exception raised inside the lambda. Moreover, in this
> particular case, I don't know if users some code could be broken if we make
> the user get a CacheException that wrappes the ParseException instead of the
> ParseException itself.
>
> How can I fix the problem ?
> Should we correct the tests and say that, from now on, CacheException will
> be raised ?
> Should we handle this CacheException in the QueryCache class when
> computeIfAbsent is called ?
> Should we propagate the lambda's exception as it is ?
>
> Katia
>
> [1]
> https://github.com/infinispan/infinispan/blob/master/query/src/main/java/org/infinispan/query/dsl/embedded/impl/QueryCache.java#L79
> [2]
> https://github.com/infinispan/infinispan/blob/master/query/src/test/java/org/infinispan/query/dsl/embedded/QueryDslConditionsTest.java#L1913
>
>
> _______________________________________________
> infinispan-dev mailing list
> [hidden email]
> https://lists.jboss.org/mailman/listinfo/infinispan-dev
_______________________________________________
infinispan-dev mailing list
[hidden email]
https://lists.jboss.org/mailman/listinfo/infinispan-dev


_______________________________________________
infinispan-dev mailing list
[hidden email]
https://lists.jboss.org/mailman/listinfo/infinispan-dev
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: [infinispan-dev] Unwrapping exceptions

Katia Aresti
Thank you for your thoughts ! I do agree with you.

Dan, do you have any objection to this ?

Katia

On Fri, May 5, 2017 at 6:54 PM, Wolf Fink <[hidden email]> wrote:
+1 for Sanne
I would expect the same and I suppose one or more customers will raise this issue

On Fri, Apr 28, 2017 at 12:56 PM, Sanne Grinovero <[hidden email]> wrote:
Personally as a user I'd expect to have a CacheException raised if and
only if it's not caused by my own code.

Imagine my own lambda is explicitly throwing an exception of a type of
my choice, it would be nice to receive that error and not a different
one.

On 28 April 2017 at 11:38, Katia Aresti <[hidden email]> wrote:
> Hi all !
>
> Radim pointed me to this thread discussing the exceptions launched by the
> lambda executed by the user.
>
> So, I've came accros this problem right now with the compute method.
>
> ComputeIfAbsent is used by the QueryCache [1]
>
> This method is now a Command, so when the wrapped lambda throws an
> exception, [2], the expected exception is the one raised by the lambda. But
> with my modifications, this exception is wrapped in a CacheException.
>
> I discussed with Adrien yesterday, and IMHO and his, a CacheException is not
> the same thing as the exception raised inside the lambda. Moreover, in this
> particular case, I don't know if users some code could be broken if we make
> the user get a CacheException that wrappes the ParseException instead of the
> ParseException itself.
>
> How can I fix the problem ?
> Should we correct the tests and say that, from now on, CacheException will
> be raised ?
> Should we handle this CacheException in the QueryCache class when
> computeIfAbsent is called ?
> Should we propagate the lambda's exception as it is ?
>
> Katia
>
> [1]
> https://github.com/infinispan/infinispan/blob/master/query/src/main/java/org/infinispan/query/dsl/embedded/impl/QueryCache.java#L79
> [2]
> https://github.com/infinispan/infinispan/blob/master/query/src/test/java/org/infinispan/query/dsl/embedded/QueryDslConditionsTest.java#L1913
>
>
> _______________________________________________
> infinispan-dev mailing list
> [hidden email]
> https://lists.jboss.org/mailman/listinfo/infinispan-dev
_______________________________________________
infinispan-dev mailing list
[hidden email]
https://lists.jboss.org/mailman/listinfo/infinispan-dev


_______________________________________________
infinispan-dev mailing list
[hidden email]
https://lists.jboss.org/mailman/listinfo/infinispan-dev


_______________________________________________
infinispan-dev mailing list
[hidden email]
https://lists.jboss.org/mailman/listinfo/infinispan-dev
Loading...