All Known Implementing Classes:
FailResponseException, FailStep.FailException

public interface Failure
Represents a failure raised by the GraphTraversal.fail() step which forces a traversal to immediately stop in an error state. Implementations carry the contextual information about where and why the failure occurred so that it can be inspected programmatically or rendered for display by way of format().

When a fail() occurs in embedded mode the full context (the offending Traverser and Traversal) is available. When reconstructed from a remote server response, that context is not transmitted and the relevant accessors may return null. Implementations and callers should account for that possibility.

Author:
Stephen Mallette (http://stephen.genoprime.com)
  • Method Details

    • getMessage

      String getMessage()
      Gets the message associated with the failure as provided to the fail() step.
    • getMetadata

      Map<String,Object> getMetadata()
      Gets any additional metadata associated with the failure. Returns an empty Map when there is no metadata.
    • getTraverser

      Traverser.Admin getTraverser()
      Gets the Traverser that was being processed when the failure was triggered. May return null when the Failure was reconstructed from a remote response where this context is not available.
    • getTraversal

      Traversal.Admin getTraversal()
      Gets the Traversal that contained the fail() step that triggered the failure. May return null when the Failure was reconstructed from a remote response where this context is not available.
    • format

      default String format()
      Gets the Failure as a formatted string representation.