Class EmptyCvvException

java.lang.Object
java.lang.Throwable
java.lang.Exception
com.goldenleaf.shop.exception.EmptyCvvException
All Implemented Interfaces:
Serializable

public class EmptyCvvException extends Exception
Checked exception thrown when an attempt is made to process or temporarily store a credit-card CVV (Card Verification Value) that is null, empty, or consists only of whitespace.

The CVV is a mandatory security code required for most card-not-present transactions. This exception enforces that a CVV is supplied during payment processing (even though it is never persisted to the database).

Common situations that trigger this exception:

  • User submits a payment form without entering the CVV
  • Calling CreditCard.setCvv(String) with null, empty string, or only whitespace
  • Validation step before sending data to a payment gateway
  • Programmatic payment processing with incomplete card data

This is a checked exception, forcing the caller to handle the missing CVV explicitly — appropriate for expected, recoverable validation errors during checkout or payment-method registration.

Since:
1.0
See Also:
  • Constructor Details

    • EmptyCvvException

      public EmptyCvvException(String message)
      Constructs a new empty-CVV exception with the specified detail message.
      Parameters:
      message - the detail message (e.g. "CVV code cannot be null or empty") Saved for later retrieval by Throwable.getMessage()
    • EmptyCvvException

      public EmptyCvvException(String message, Throwable cause)
      Constructs a new empty-CVV exception with the specified detail message and cause.

      Useful when wrapping a lower-level exception (e.g., validation framework error, constraint violation, or payment-gateway response parsing issue).

      Parameters:
      message - the detail message
      cause - the original cause of the error
      Since:
      1.2