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
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 Summary
ConstructorsConstructorDescriptionReadException(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 TypeMethodDescriptionReturns the underlying I/O cause of this exception.Returns the exception message.toString()Returns a string representation of this exception.Methods inherited from class org.codehaus.groovy.GroovyException
isFatal, setFatalMethods inherited from class java.lang.Throwable
addSuppressed, fillInStackTrace, getCause, getLocalizedMessage, getStackTrace, getSuppressed, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace
-
Constructor Details
-
ReadException
Constructs a ReadException from an I/O exception. No specific message is provided.- Parameters:
cause- theIOExceptionthat triggered this exception
-
ReadException
Constructs a ReadException from a message and an I/O exception.- Parameters:
message- the error messagecause- the underlyingIOExceptionthat triggered this exception
-
-
Method Details
-
getIOCause
Returns the underlying I/O cause of this exception.- Returns:
- the
IOExceptionthat caused this exception
-
toString
Returns a string representation of this exception. If no custom message was provided, returns the cause's message. -
getMessage
Returns the exception message. Equivalent totoString()for this exception type.- Overrides:
getMessagein classThrowable- Returns:
- the exception message or I/O cause message
-