public default String format() {
        final List<String> lines = new ArrayList<>();
        final Step parentStep = (Step) getTraversal().getParent();

        lines.add(String.format("Message  > %s", getMessage()));
        lines.add(String.format("Traverser> %s", getTraverser().toString()));

        final TraverserGenerator generator = getTraversal().getTraverserGenerator();
        final Traverser.Admin traverser = getTraverser();
        if (generator.getProvidedRequirements().contains(TraverserRequirement.BULK)) {
            lines.add(String.format("  Bulk   > %s", traverser.bulk()));
        }
        if (generator.getProvidedRequirements().contains(TraverserRequirement.SACK)) {
            lines.add(String.format("  Sack   > %s", traverser.sack()));
        }
        if (generator.getProvidedRequirements().contains(TraverserRequirement.PATH)) {
            lines.add(String.format("  Path   > %s", traverser.path()));
        }
        if (generator.getProvidedRequirements().contains(TraverserRequirement.SINGLE_LOOP) ||
                generator.getProvidedRequirements().contains(TraverserRequirement.NESTED_LOOP) ) {
            final Set<String> loopNames = traverser.getLoopNames();
            final String loopsLine = loopNames.isEmpty() ?
                    String.valueOf(traverser.asAdmin().loops()) :
                    loopNames.stream().collect(Collectors.toMap(loopName -> loopName, traverser::loops)).toString();
            lines.add(String.format("  Loops  > %s", loopsLine));
        }
        if (generator.getProvidedRequirements().contains(TraverserRequirement.SIDE_EFFECTS)) {
            final TraversalSideEffects tse = traverser.getSideEffects();
            final Set<String> keys = tse.keys();
            lines.add(String.format("  S/E    > %s", keys.stream().collect(Collectors.toMap(k -> k, tse::get))));
        }

        // removes the starting period so that "__.out()" simply presents as "out()"
        lines.add(String.format("Traversal> %s", getTraversal().getGremlinLang().getGremlin().substring(1)));

        // not sure there is a situation where fail() would be used where it was not wrapped in a parent,
        // but on the odd case that it is it can be handled
        if (parentStep != EmptyStep.instance()) {
            lines.add(String.format("Parent   > %s [%s]",
                    parentStep.getClass().getSimpleName(), getTraversal().getGremlinLang().getGremlin().substring(1)));
        }

        lines.add(String.format("Metadata > %s", getMetadata()));

        final int longestLineLength = lines.stream().mapToInt(String::length).max().getAsInt();
        final String separatorLine = String.join("", Collections.nCopies(longestLineLength, "="));
        lines.add(0, separatorLine);
        lines.add(0, "fail() Step Triggered");
        lines.add(separatorLine);

        return String.join(System.lineSeparator(), lines);
    }
Gets the {@code Failure} as a formatted string representation.
gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/Failure.java