Class UnableToCompleteException

public class UnableToCompleteException
extends Exception
Used to indicate that some part of a multi-step process failed. Typically, operation can continue after this exception is caught. Before throwing an object of this type, the thrower After catching an object of this type, the catcher
  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);
      }    
  }
 

Constructors

UnableToCompleteException()

Constructor Detail

UnableToCompleteException

public UnableToCompleteException()