/** * Consume a record and send it to the relevant output transforms. * * @param input the record to consume * @throws StageFailureException if there was an exception consuming the input */ public void consume(T input) { try { consumeInput(input); } catch (StageFailureException e) { // Another stage has already failed, just throw the exception as-is throw e; } catch (Exception e) { Throwable rootCause = Throwables.getRootCause(e); // Create StageFailureException to save the Stage information throw new StageFailureException( String.format("Failed to execute pipeline stage '%s' with the error: %s. Please review your pipeline " + "configuration and check the system logs for more details.", stageName, rootCause.getMessage()), rootCause); } }