Class UriValidationException

All Implemented Interfaces:
Serializable

public class UriValidationException extends IllegalArgumentException
A URI validation exception.

This type provides access to the invalid value that is not cleaned, through invalidValue(). The exception message is cleaned and can be logged and returned to users (Throwable.getMessage()).

See Also:
  • Constructor Details

    • UriValidationException

      public UriValidationException(UriValidationException.Segment segment, char[] invalidValue, String message)
      Create a new validation exception that uses a descriptive message and the failed chars. The message provided will be appended with cleaned invalid value in double quotes.
      Parameters:
      segment - segment that caused this exception
      invalidValue - value that failed validation
      message - descriptive message
  • Method Details

    • invalidValue

      public char[] invalidValue()
      The value that did not pass validation. This value is as it was received over the network, so it is not safe to log or return to the user!
      Returns:
      invalid value that failed validation
    • segment

      Segment that caused this validation exception.
      Returns:
      segment of the URI