Class ConversionException

java.lang.Object
java.lang.Throwable
java.lang.Exception
com.oorian.data.converter.ConversionException
All Implemented Interfaces:
Serializable

public class ConversionException extends Exception
Thrown when a type conversion fails.

The Throwable.getMessage() method returns a user-friendly message suitable for displaying in the UI (e.g., "Please enter a valid number"). The original invalid value is available via getInvalidValue().

Since:
2.1
Version:
1.0
Author:
Marvin P. Warble Jr.
See Also:
  • Constructor Details

    • ConversionException

      public ConversionException(String message)
      Creates a new ConversionException with a user-friendly message.
      Parameters:
      message - a user-friendly error message
    • ConversionException

      public ConversionException(String message, Object invalidValue)
      Creates a new ConversionException with a message and the invalid value.
      Parameters:
      message - a user-friendly error message
      invalidValue - the value that could not be converted
    • ConversionException

      public ConversionException(String message, Object invalidValue, Throwable cause)
      Creates a new ConversionException with a message, invalid value, and cause.
      Parameters:
      message - a user-friendly error message
      invalidValue - the value that could not be converted
      cause - the underlying cause
  • Method Details

    • getInvalidValue

      public Object getInvalidValue()
      Returns the value that could not be converted.
      Returns:
      the invalid value, or null if not available