Package org.codehaus.groovy.syntax

# Class ReadException

java.lang.Object
java.lang.Throwable
java.lang.Exception
org.codehaus.groovy.GroovyException
org.codehaus.groovy.syntax.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:
  - Serialized Form

- ## Constructor Summary

  Constructors
  Constructor
  Description
  `ReadException(IOException cause)`
  Constructs a ReadException from an I/O exception.
  `ReadException(String message, IOException cause)`
  Constructs a ReadException from a message and an I/O exception.

- ## Method Summary

  Modifier and Type
  Method
  Description
  `IOException`
  `getIOCause()`
  Returns the underlying I/O cause of this exception.
  `String`
  `getMessage()`
  Returns the exception message.
  `String`
  `toString()`
  Returns a string representation of this exception.

  ### Methods inherited from class org.codehaus.groovy.GroovyException

  `isFatal, setFatal`

  ### Methods inherited from class java.lang.Throwable

  `addSuppressed, fillInStackTrace, getCause, getLocalizedMessage, getStackTrace, getSuppressed, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace`

  ### Methods inherited from class java.lang.Object

  `clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait`

- ## 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