Package com.exonum.binding.transaction
Class TransactionExecutionException
- java.lang.Object
-
- java.lang.Throwable
-
- java.lang.Exception
-
- com.exonum.binding.transaction.TransactionExecutionException
-
- All Implemented Interfaces:
java.io.Serializable
public class TransactionExecutionException extends java.lang.Exception
An exception occurred during transaction execution. The transaction exception includes an integer error code, that may be either service-specific or transaction-specific; and an optional description — an exception message. Both the error code and the description are saved in the database, but only the value of the error code affects the blockchain state.The other attributes of a Java exception — a stack trace, a cause, suppressed exceptions — are not saved in the database and are used for logging only.
An external client will get the error code and description when requests a transaction status of a failed transaction. See the API endpoint documentation for more information.
- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description TransactionExecutionException(byte errorCode)
Constructs a new transaction exception with no description.TransactionExecutionException(byte errorCode, java.lang.String description)
Constructs a new transaction exception with the specified description.TransactionExecutionException(byte errorCode, java.lang.String description, java.lang.Throwable cause)
Constructs a new transaction exception with the specified description and cause.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description byte
getErrorCode()
Returns the transaction error code.java.lang.String
toString()
Returns a string representation of this error.
-
-
-
Constructor Detail
-
TransactionExecutionException
public TransactionExecutionException(byte errorCode)
Constructs a new transaction exception with no description.- Parameters:
errorCode
- the transaction error code
-
TransactionExecutionException
public TransactionExecutionException(byte errorCode, @Nullable java.lang.String description)
Constructs a new transaction exception with the specified description.- Parameters:
errorCode
- the transaction error codedescription
- the error description. The detail description is saved for later retrieval by theThrowable.getMessage()
method.
-
TransactionExecutionException
public TransactionExecutionException(byte errorCode, @Nullable java.lang.String description, @Nullable java.lang.Throwable cause)
Constructs a new transaction exception with the specified description and cause.Note that the detail message associated with
cause
is not automatically incorporated in this exception’s detail message.- Parameters:
errorCode
- the transaction error codedescription
- the error description. The detail description is saved for later retrieval by theThrowable.getMessage()
method.cause
- the cause (which is saved for later retrieval by theThrowable.getCause()
method). A null value is permitted, and indicates that the cause is nonexistent or unknown.
-
-
Method Detail
-
getErrorCode
public final byte getErrorCode()
Returns the transaction error code.
-
toString
public java.lang.String toString()
Returns a string representation of this error. Includes the actual class name, the optional description and the error code.- Overrides:
toString
in classjava.lang.Throwable
-
-