How so? You can mask exceptions with around advice by catching them and you
can have a finally block after that. For example:
aspect ErrorHandling {
pointcut handled() : ...;
Object around() : handled() {
try {
return proceed();
} catch (ThisException e) {
disableOptionalService();
// ok - handled
} finally {
releaseResources();
}
}
...
}
-----Original Message-----
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of Fernando Castor
Filho
Sent: Friday, September 22, 2006 4:31 PM
To: [email protected]
Subject: Re: [aspectj-users] after throwing question ...
This is the main reason why it is not possible to implement exception
masking with around advice. It is also not possible to mimic the
semantics of "finally" blocks.
Kind regards,
Fernando
On 9/22/06, Ron Bodkin <[EMAIL PROTECTED]> wrote:
> Hi Fabio,
>
> You could rethrow another exception in after throwing advice but to exit
the
> join point without throwing you would need to catch it in an around
advice.
>
>
> -----Original Message-----
> From: [EMAIL PROTECTED]
> [mailto:[EMAIL PROTECTED] On Behalf Of Fabio Fagundes
> Silveira
> Sent: Friday, September 22, 2006 10:26 AM
> To: [email protected]
> Subject: [aspectj-users] after throwing question ...
>
> Hello,
>
> Is there any way to "stop" an exception propagation raised in a
> method? For example:
>
> after(Object o, double d) throwing:
> execution(* Foo.m1(..)) &&
> target(o)
> && args(d){
>
> //do something
>
> //stop the exception propagation
>
> }
>
> }
>
>
> In such example, after m1 returns with an exception raised, I would
> like to do something and stop or "catch" such an exception ... I know
> that with around it is possible ... but is it with after throwing?
>
> Regards,
> Fabio
>
>
>
> _______________________________________________
> aspectj-users mailing list
> [email protected]
> https://dev.eclipse.org/mailman/listinfo/aspectj-users
>
> _______________________________________________
> aspectj-users mailing list
> [email protected]
> https://dev.eclipse.org/mailman/listinfo/aspectj-users
>
_______________________________________________
aspectj-users mailing list
[email protected]
https://dev.eclipse.org/mailman/listinfo/aspectj-users
_______________________________________________
aspectj-users mailing list
[email protected]
https://dev.eclipse.org/mailman/listinfo/aspectj-users