Interface Failure
-
public interface FailureRepresents a failure raised by theGraphTraversal.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 offormat(). When afail()occurs in embedded mode the full context (the offendingTraverserandTraversal) is available. When reconstructed from a remote server response, that context is not transmitted and the relevant accessors may returnnull. Implementations and callers should account for that possibility.- Author:
- Stephen Mallette (http://stephen.genoprime.com)
-
-
Field Summary
Fields Modifier and Type Field Description static Translator.ScriptTranslatorTRANSLATOR
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description default Stringformat()Gets theFailureas a formatted string representation.StringgetMessage()Gets the message associated with the failure as provided to thefail()step.Map<String,Object>getMetadata()Gets any additional metadata associated with the failure.Traversal.AdmingetTraversal()Gets theTraversalthat contained thefail()step that triggered the failure.Traverser.AdmingetTraverser()Gets theTraverserthat was being processed when the failure was triggered.
-
-
-
Field Detail
-
TRANSLATOR
static final Translator.ScriptTranslator TRANSLATOR
-
-
Method Detail
-
getMessage
String getMessage()
Gets the message associated with the failure as provided to thefail()step.
-
getMetadata
Map<String,Object> 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
default String format()
Gets theFailureas a formatted string representation.
-
-