Class TransactionExecutionException
- java.lang.Object
-
- java.lang.Throwable
-
- java.lang.Exception
-
- com.exonum.binding.core.transaction.TransactionExecutionException
-
- All Implemented Interfaces:
Serializable
public class TransactionExecutionException extends 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:
TransactionResult
, Serialized Form
-
-
Constructor Summary
Constructors Constructor Description TransactionExecutionException(byte errorCode)
Constructs a new transaction exception with no description.TransactionExecutionException(byte errorCode, String description)
Constructs a new transaction exception with the specified description.TransactionExecutionException(byte errorCode, String description, 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.String
toString()
Returns a string representation of this error.-
Methods inherited from class java.lang.Throwable
addSuppressed, fillInStackTrace, getCause, getLocalizedMessage, getMessage, getStackTrace, getSuppressed, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace
-
-
-
-
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 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 String description, @Nullable 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.
-
-