dir-spooler-protolib/src/main/java/com/streamsets/pipeline/lib/dirspooler/SpoolDirRunnable.java
private void handleStageError(ErrorCode errorCode, Exception e) {
    final String errorMessage = "Failure Happened";
    LOG.error(errorMessage, e);
    try {
      errorRecordHandler.onError(errorCode, e);
    } catch (StageException se) {
      LOG.error("Error when routing to stage error", se);
      //Way to throw stage exception from runnable to main source thread
      Throwables.propagate(se);
    }
  }
private void handleStageError(ErrorCode errorCode, Exception e) {
    final String errorMessage = "Failure Happened";
    LOG.error(errorMessage, e);
    try {
      errorRecordHandler.onError(errorCode, e);
    } catch (StageException se) {
      LOG.error("Error when routing to stage error", se);
      //Way to throw stage exception from runnable to main source thread
      Throwables.propagate(se);
    }
  }
Handle Exception