Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [aspectj-users] Catch with AspectJ

Maybe you can use "throws" pcd which might be useful in that case. But
AFAIK, it captures if the method -throws- an exception not -catches-
it. Hence you might need to remove the exception handling code from
the original method and handle it using aspectj.

On 7/31/07, Filipe Costa <filipe.fgcosta@xxxxxxxxx> wrote:
> Hi
>
> I'm starting with AspectJ and I have a lot of packages and in which them
> java classes. I want to do an aspect that capture every exceptions and do
> something like that:
>
> logger.logp(Level.SEVERE, <class name>.class.getName(), "method name",
> e.getMessage());
>
> Because every exceptions has a same kind of catch, lake that:
>
> (…)
> catch(<something>Exception e)
>             {
>                 logger.logp(Level.SEVERE, <class name>.class.getName(),
> "method name", e.getMessage());
>             }
>
> Can someone give me an idea?
>
> thank you
>
> fg_costa
>
> _______________________________________________
> aspectj-users mailing list
> aspectj-users@xxxxxxxxxxx
> https://dev.eclipse.org/mailman/listinfo/aspectj-users
>
>


Back to the top