1. When the exception-handling logic is specific to the current method, I like to scope it to the current method. Even if we have a
private void handleException
, it can still be called by other methods in the current class.2. With a private exception-handling method, you will need to pass in all the info needed for handling the exception, in addition to the
Exception
. In addition, what info is needed may change overtime. This may lead to methods like this:private void handleException(Exception e, String name, String info)
throws AppException
Tags: java, java exception