code: private void endUnitOfWork(Throwable originalThrowable) throws Throwable {
      try {
        unitOfWork.end();
      } catch (Throwable t) {
        if (originalThrowable != null) {
          throw originalThrowable;
        } else {
          throw t;
        }
      }
    }
docs: Ends the unit of work.
  
  <p>If originalThrowable is present, and an exception is thrown, then the originalThrowable
  will be preferred and thrown instead; if originalThrowable is not present, and an exception is
  thrown, then the unitOfWork exception will be thrown.
  
  @param originalThrowable the original exception that was thrown and should be propagated
  @throws Throwable if an exception occurred while ending the unit of work