Class EmptyCvvException
java.lang.Object
java.lang.Throwable
java.lang.Exception
com.goldenleaf.shop.exception.EmptyCvvException
- All Implemented Interfaces:
Serializable
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)withnull, 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 Summary
ConstructorsConstructorDescriptionEmptyCvvException(String message) Constructs a new empty-CVV exception with the specified detail message.EmptyCvvException(String message, Throwable cause) Constructs a new empty-CVV exception with the specified 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
-
EmptyCvvException
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 byThrowable.getMessage()
-
EmptyCvvException
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 messagecause- the original cause of the error- Since:
- 1.2
-