public class UnableToCompleteException extends Exception
void lowLevel(Logger logger) throws UnableToCompleteException { try { doSomethingThatMightFail(); catch (SomeException e) { // Log low-level detail and the caught exception. // logger.log("detailed problem explanation for user eyes...", e); // Do not include the caught exception. // throw new UnableToCompleteException(); } } void highLevel(Logger logger) { try { // Multiple calls are shown to indicate that the process can // include any number of steps. // lowLevel(logger); lowLevel(logger); lowLevel(logger); } catch (UnableToCompleteException e) { logger.log("high-level thing failed", e); } }
Constructor and Description |
---|
UnableToCompleteException() |
addSuppressed, fillInStackTrace, getCause, getLocalizedMessage, getMessage, getStackTrace, getSuppressed, initCause, printStackTrace, printStackTrace, setStackTrace, toString
Copyright © 2018. All rights reserved.