Class TxnError

java.lang.Object
io.vertx.ext.consul.TxnError

public class TxnError extends Object
Holds information describing which operations failed if the transaction was rolled back.
Author:
Ruslan Sennov
  • Constructor Details

    • TxnError

      public TxnError()
      Default constructor
    • TxnError

      public TxnError(JsonObject json)
      Constructor from JSON
      Parameters:
      json - the JSON
  • Method Details

    • toJson

      public JsonObject toJson()
      Convert to JSON
      Returns:
      the JSON
    • getOpIndex

      public int getOpIndex()
      Get the index of the failed operation in the transaction
      Returns:
      the index of the failed operation in the transaction
    • getWhat

      public String getWhat()
      Get error message about why that operation failed.
      Returns:
      error message about why that operation failed.
    • setOpIndex

      public TxnError setOpIndex(int opIndex)
      Set the index of the failed operation in the transaction
      Parameters:
      opIndex - the index of the failed operation in the transaction
      Returns:
      reference to this, for fluency
    • setWhat

      public TxnError setWhat(String what)
      Set error message about why that operation failed.
      Parameters:
      what - error message about why that operation failed.
      Returns:
      reference to this, for fluency