Interface Failure
- 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 Summary
Modifier and TypeMethodDescriptiondefault Stringformat()Gets theFailureas a formatted string representation.Gets the message associated with the failure as provided to thefail()step.Gets any additional metadata associated with the failure.Gets theTraversalthat contained thefail()step that triggered the failure.Gets theTraverserthat was being processed when the failure was triggered.
-
Method Details
-
getMessage
String getMessage()Gets the message associated with the failure as provided to thefail()step. -
getMetadata
Gets any additional metadata associated with the failure. Returns an emptyMapwhen there is no metadata. -
getTraverser
Traverser.Admin getTraverser()Gets theTraverserthat was being processed when the failure was triggered. May returnnullwhen theFailurewas reconstructed from a remote response where this context is not available. -
getTraversal
Traversal.Admin getTraversal()Gets theTraversalthat contained thefail()step that triggered the failure. May returnnullwhen theFailurewas reconstructed from a remote response where this context is not available. -
format
Gets theFailureas a formatted string representation.
-