Class FormException

All Implemented Interfaces:
Serializable
Direct Known Subclasses:
FormFieldException

@NotThreadSafe public class FormException extends RuntimeException
Exception thrown when a form is invalid. Problems with a specific form field should use FormFieldException instead.

You can safely throw FormException from within your form validator, and the message will automatically be propagated to the client form interface.

See Also:
  • Constructor Details

    • FormException

      public FormException(@Detainted String userMessage)
      Creates a new FormException
      Parameters:
      userMessage - should be a friendly message that's safe to show to the user.
    • FormException

      public FormException(@Detainted String userMessage, Throwable cause)
      Creates a new FormException
      Parameters:
      userMessage - should be a friendly message that's safe to show to the user.
      cause - the original cause of this exception. May be null.
  • Method Details

    • getMessage

      @Detainted public String getMessage()
      Returns an error message that's safe to display to the user.
      Overrides:
      getMessage in class Throwable