Class ReadException

All Implemented Interfaces:
Serializable, GroovyExceptionInterface

public class ReadException extends GroovyException
Exception that wraps I/O exceptions (IOException) in a Groovy-specific context. Provides convenient access to the underlying I/O cause while maintaining the GroovyException hierarchy.
See Also:
  • Constructor Details

    • ReadException

      public ReadException(IOException cause)
      Constructs a ReadException from an I/O exception. No specific message is provided.
      Parameters:
      cause - the IOException that triggered this exception
    • ReadException

      public ReadException(String message, IOException cause)
      Constructs a ReadException from a message and an I/O exception.
      Parameters:
      message - the error message
      cause - the underlying IOException that triggered this exception
  • Method Details

    • getIOCause

      public IOException getIOCause()
      Returns the underlying I/O cause of this exception.
      Returns:
      the IOException that caused this exception
    • toString

      public String toString()
      Returns a string representation of this exception. If no custom message was provided, returns the cause's message.
      Overrides:
      toString in class Throwable
      Returns:
      the exception message or I/O cause message
    • getMessage

      public String getMessage()
      Returns the exception message. Equivalent to toString() for this exception type.
      Overrides:
      getMessage in class Throwable
      Returns:
      the exception message or I/O cause message