I often use log and throw, but not in the way you post it; I use it like this:
catch(SomeException e){
log.error("I got exception: "+e.getMessage());
throw new SomeOtherException("I got exception:"
+e.getMessage(),e);
}
This way you don't print multiple stacktraces but keep track of the context in which the exception happened, along with some possibly meningful info, maybe about what method threw the Exception.
I think it is clearer than having to lookup the line where the exception was thrown.
Regards, Riccardo |