Class EmptyContentException

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

public class EmptyContentException extends Exception
Checked exception thrown when an attempt is made to create or save a review (or any other user-generated textual content) with an empty or missing text body.

The content of a Review is a mandatory field. This exception guarantees that only meaningful reviews are persisted, preventing spam, accidental submissions, or incomplete data.

Typical scenarios that trigger this exception:

Being a checked exception, the caller must explicitly handle it or declare it in the throws clause. This is appropriate for expected, recoverable validation errors in normal application flow.

Since:
1.0
See Also:
  • Constructor Details

    • EmptyContentException

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

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

      Useful when this validation exception wraps a lower-level technical exception (e.g., constraint violation, parsing error, etc.).

      Parameters:
      message - the detail message
      cause - the root cause of this exception
      Since:
      1.2