Lets take an example.
public String myMethod(String s) throws ExceptionA, ExceptionB {
}
Is it bad to have this kind of multiple exception throwing from a method. i.e. do we need to simplify that as below using a wrapper?
public String myMethod(String s) throws ExceptionC{
try{
}catch(ExceptionA | ExceptionB e){
throw new ExceptionC(e);
}
}
If so, how can I find the root cause exception in higher level classes to log, when we bubble up the exception to the top?