Package com.privatechain.core.exception
Class BlockchainException
java.lang.Object
java.lang.Throwable
java.lang.Exception
java.lang.RuntimeException
com.privatechain.core.exception.BlockchainException
- All Implemented Interfaces:
Serializable
- Direct Known Subclasses:
BlockValidationException,ConsensusException,TransactionValidationException
Root unchecked exception for all errors thrown by the private-blockchain library.
All library-specific exceptions extend this class so that consumers can write
a single catch (BlockchainException e) to handle any library error
(NFR-UX-03). Using an unchecked base means callers are never forced to declare
checked exceptions in their APIs, keeping consumer code clean.
Do not instantiate this class directly. Use one of the specific subtypes:
BlockValidationException— block failed consensus or integrity checkConsensusException— unrecoverable error in the consensus engineTransactionValidationException— transaction failed validation
- Since:
- 1.0.0
- See Also:
-
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedBlockchainException(String message) Constructs aBlockchainExceptionwith a detail message.protectedBlockchainException(String message, Throwable cause) Constructs aBlockchainExceptionwith a detail message and cause. -
Method Summary
Methods inherited from class java.lang.Throwable
addSuppressed, fillInStackTrace, getCause, getLocalizedMessage, getMessage, getStackTrace, getSuppressed, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
-
Constructor Details
-
BlockchainException
Constructs aBlockchainExceptionwith a detail message.- Parameters:
message- human-readable description of the error
-
BlockchainException
Constructs aBlockchainExceptionwith a detail message and cause.- Parameters:
message- human-readable description of the errorcause- the underlying exception that triggered this one
-