Top Description Fields Constructors Methods
org.codehaus.groovy

public Class GroovyBugError

extends AssertionError
Class Inheritance

This class represents an error that is thrown when a bug is recognized inside the runtime. Basically it is thrown when a constraint is not fulfilled that should be fulfilled.

Field Summary

Modifier and TypeField and Description
private final Exception
private String
private static final long

Constructor Summary

AccessConstructor and Description
public
GroovyBugError(String
the error message text
message
)

constructs a bug error using the given text

public
GroovyBugError(Exception
cause of this error
exception
)

Constructs a bug error using the given exception

public
GroovyBugError(String
additional information about this error
msg
,
Exception
cause of this error
exception
)

Constructs a bug error using the given exception and a text with additional information about the cause

Method Summary

Modifier and TypeMethod and Description
public String
getBugText()

Returns the bug text to describe this error

public Throwable
getCause()

Overrides java.lang.Throwable.getCause.

Returns the cause of this throwable or null if the cause is nonexistent or unknown.
public String

Returns:

the detail message string of this error.
getMessage
()

Overrides java.lang.Throwable.getMessage.

Returns the detail message string of this error.
public void
setBugText(String msg)

Sets the bug text to describe this error

public String
toString()

Overrides java.lang.Throwable.toString.

Returns a String representation of this class by calling getMessage().

Field Detail

exceptionback to summary
private final Exception exception
messageback to summary
private String message
serialVersionUIDback to summary
private static final long serialVersionUID

Hides java.lang.AssertionError.serialVersionUID.

Constructor Detail

GroovyBugErrorback to summary
public GroovyBugError(String message)

constructs a bug error using the given text

Parameters
message:String

the error message text

GroovyBugErrorback to summary
public GroovyBugError(Exception exception)

Constructs a bug error using the given exception

Parameters
exception:Exception

cause of this error

GroovyBugErrorback to summary
public GroovyBugError(String msg, Exception exception)

Constructs a bug error using the given exception and a text with additional information about the cause

Parameters
msg:String

additional information about this error

exception:Exception

cause of this error

Method Detail

getBugTextback to summary
public String getBugText()

Returns the bug text to describe this error

getCauseback to summary
public Throwable getCause()

Overrides java.lang.Throwable.getCause.

Doc from java.lang.Throwable.getCause.

Returns the cause of this throwable or null if the cause is nonexistent or unknown. (The cause is the throwable that caused this throwable to get thrown.)

This implementation returns the cause that was supplied via one of the constructors requiring a Throwable, or that was set after creation with the initCause(Throwable) method. While it is typically unnecessary to override this method, a subclass can override it to return a cause set by some other means. This is appropriate for a "legacy chained throwable" that predates the addition of chained exceptions to Throwable. Note that it is not necessary to override any of the PrintStackTrace methods, all of which invoke the getCause method to determine the cause of a throwable.

Returns:Throwable

the cause of this throwable or null if the cause is nonexistent or unknown.

getMessageback to summary
public String getMessage()

Overrides java.lang.Throwable.getMessage.

Returns the detail message string of this error. The message will consist of the bug text prefixed by "BUG! " if there this instance was created using a message. If this error was constructed without using a bug text the message of the cause is used prefixed by "BUG! UNCAUGHT EXCEPTION: "

Returns:String

the detail message string of this error.

setBugTextback to summary
public void setBugText(String msg)

Sets the bug text to describe this error

toStringback to summary
public String toString()

Overrides java.lang.Throwable.toString.

Returns a String representation of this class by calling getMessage().

Returns:String

Doc from java.lang.Throwable.toString.

a string representation of this throwable.

See Also
getMessage()