class 1:
public static void TypeOneException2TypeTwoException(TypeOneException exception)
throws TypeTwoException {
if (exception == null)
throw new IllegalArgumentException(
"TypeOneException shouldn't be null");
LOG_SERVICE.debug(exception.getMessage(), exception); //log it
if (exception instanceof TypeTwoException)
throw new TypeTwoException(
DavServletResponse.SC_METHOD_NOT_ALLOWED,
exception.getMessage());
class 2:
public void callerOne(){
try{
}catch(TypeOneException exception){
LOG_SERVICE.debug(exception.getMessage(), exception); //is still need log it? any benifit?
TypeOneException2TypeTwoException(exception)
}
class 3:
public void callerTwo(){
try{
}catch(TypeOneException exception){
LOG_SERVICE.debug(exception.getMessage(), exception); //is still need log it?
TypeOneException2TypeTwoException(exception)
}
class 4:
public void callerTwo(){
try{
}catch(TypeOneException exception){
LOG_SERVICE.debug(exception.getMessage(), exception); //is still need log it?
TypeOneException2TypeTwoException(exception)
}
as titled. I have logged the error in class1. if has any need to log it in callers(class2,3,4)? if need, any benifits existed? Thanks in advance. Suppossed need, if the duplicate code existed?