Package com.privatechain.core.exception
Class TransactionValidationException
java.lang.Object
java.lang.Throwable
java.lang.Exception
java.lang.RuntimeException
com.privatechain.core.exception.BlockchainException
com.privatechain.core.exception.TransactionValidationException
- All Implemented Interfaces:
Serializable
Thrown when a
Transaction fails one or more
TransactionValidator checks before entering
the mempool or being included in a block.
The exception carries the full ValidationResult so that callers can
inspect the specific failure reason and the list of error messages without
parsing the exception message string.
- Since:
- 1.0.0
- See Also:
-
Constructor Summary
ConstructorsConstructorDescriptionTransactionValidationException(String message, ValidationResult validationResult, Transaction transaction) Constructs aTransactionValidationException. -
Method Summary
Modifier and TypeMethodDescriptionReturns the transaction that failed validation.Returns the fullValidationResultthat caused this exception.Methods inherited from class java.lang.Throwable
addSuppressed, fillInStackTrace, getCause, getLocalizedMessage, getMessage, getStackTrace, getSuppressed, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
-
Constructor Details
-
TransactionValidationException
public TransactionValidationException(String message, ValidationResult validationResult, Transaction transaction) Constructs aTransactionValidationException.- Parameters:
message- human-readable summary of the validation failurevalidationResult- the full result from the validator (non-null)transaction- the rejected transaction (maybe null)
-
-
Method Details
-
getValidationResult
Returns the fullValidationResultthat caused this exception.- Returns:
- the validation result (non-null)
-
getTransaction
Returns the transaction that failed validation.- Returns:
- the rejected transaction, or
nullif not available
-