Yeah right, the handler() pointcut. I never needed it, so I totally forgot about it. With AspectJ there is often one more ace up your sleeve than you even notice. :-) -- Alexander Kriegisch
> Am 10.01.2014 um 21:47 schrieb Andy Clement <andrew.clem...@gmail.com>: > > Yes, if the exception is re-thrown you will see it with something like > execution() and after throwing advice. If the exception is handled internally > in the method you could use the handler() joinpoint to see it: > > catch (Exception e) { > log.error("Exception occurred"); > } > > before(Exception ex): handler(Exception) && args(ex) { > // do something with the exception > } > > The advice will run at the start of the catch block. > > Andy. > > >> On 9 January 2014 22:00, Krishna Jasty <krishna.ja...@tcs.com> wrote: >> Thanks Andy for clarification. >> >> My confusion is on how to handle the cache exception such as follows. >> >> If the cache block throws exception i can use a handler on get the >> exception. >> cache(Exception e){ >> throw e; >> } >> >> Where as if the developer just did like below, handler cannot caught it. How >> to proceed in this case. >> cache(Exception e){ >> log.error("Exception occured"); >> } >> >> Thanks, >> Krishna >> >> >> From: Andy Clement <andrew.clem...@gmail.com> >> To: aspectj-users@eclipse.org >> Date: 01/09/2014 12:22 AM >> Subject: Re: [aspectj-users] Exception cache with aspectj >> Sent by: aspectj-users-boun...@eclipse.org >> >> >> >> >> There is no joinpoint for array access so you cannot catch the exception >> unfortunately. >> >> Some form of support could be added to AspectJ, but is not currently on the >> radar. >> >> cheers, >> Andy >> >> >> On 8 January 2014 05:00, Krishna Jasty <krishna.ja...@tcs.com> wrote: >> Hi , >> Can anybody faced a similar situation like this. >> >> How to specify a pointcut and advice for caching this type of exception. >> >> try{ >> int array[]={10,20,30}; >> System.out.println("The value of array is" >> +array[5]); >> } >> catch(ArrayIndexOutOfBoundsException aiob){ >> aiob.printStackTrace(); >> } >> >> Thanks, >> Krishna >> =====-----=====-----===== >> Notice: The information contained in this e-mail >> message and/or attachments to it may contain >> confidential or privileged information. If you are >> not the intended recipient, any dissemination, use, >> review, distribution, printing or copying of the >> information contained in this e-mail message >> and/or attachments to it are strictly prohibited. If >> you have received this communication in error, >> please notify us by reply e-mail or telephone and >> immediately and permanently delete the message >> and any attachments. Thank you >> >> _______________________________________________ >> aspectj-users mailing list >> aspectj-users@eclipse.org >> https://dev.eclipse.org/mailman/listinfo/aspectj-users >> >> _______________________________________________ >> aspectj-users mailing list >> aspectj-users@eclipse.org >> https://dev.eclipse.org/mailman/listinfo/aspectj-users >> >> >> >> _______________________________________________ >> aspectj-users mailing list >> aspectj-users@eclipse.org >> https://dev.eclipse.org/mailman/listinfo/aspectj-users > > _______________________________________________ > aspectj-users mailing list > aspectj-users@eclipse.org > https://dev.eclipse.org/mailman/listinfo/aspectj-users
_______________________________________________ aspectj-users mailing list aspectj-users@eclipse.org https://dev.eclipse.org/mailman/listinfo/aspectj-users