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

public abstract class BlockchainException extends RuntimeException
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:

Since:
1.0.0
See Also:
  • Constructor Details

    • BlockchainException

      protected BlockchainException(String message)
      Constructs a BlockchainException with a detail message.
      Parameters:
      message - human-readable description of the error
    • BlockchainException

      protected BlockchainException(String message, Throwable cause)
      Constructs a BlockchainException with a detail message and cause.
      Parameters:
      message - human-readable description of the error
      cause - the underlying exception that triggered this one