[
Date Prev][
Date Next][
Thread Prev][
Thread Next][
Date Index][
Thread Index]
[
List Home]
[aspectj-users] : extracting source code with exceptions into an aspect
|
Hi everyone,
I'm trying to extract some generic code included in some methods of a business class in order to put it in an aspect. The "problem is that this code generates a multitude of exceptions. I don't really know what is the suitable method to manage these exceptions in the aspect.
I have something like this:
public MyType method1(some parameters) throws unkownResourceParameter, unkownService, <other exceptions...>{
/*transversal code of checking the parameters values*/
try{
if( parameter1 = null){
logger.warn(...);
throw new BadParameterException(...);
}
if(parameter2 =null){
logger.warn(..);
throw new ....
}
/*some other code*/
try{...
}catch(){
...}}
catch(){
throw new...}
catch(){
...}
...
}
when I exctract the generic code (included in the try bloc) I must have catch blocs in my code advice, but these blocs aren't exactly the same depending in each method.
What should I do for this?
thanks for help.