Class GroovyBugError

java.lang.Object
java.lang.Throwable
java.lang.Error
java.lang.AssertionError
org.codehaus.groovy.GroovyBugError
All Implemented Interfaces:
java.io.Serializable

public class GroovyBugError
extends java.lang.AssertionError
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.
See Also:
Serialized Form
  • Constructor Summary

    Constructors
    Constructor Description
    GroovyBugError​(java.lang.Exception exception)
    Constructs a bug error using the given exception
    GroovyBugError​(java.lang.String message)
    constructs a bug error using the given text
    GroovyBugError​(java.lang.String msg, java.lang.Exception exception)
    Constructs a bug error using the given exception and a text with additional information about the cause
  • Method Summary

    Modifier and Type Method Description
    java.lang.String getBugText()
    Returns the bug text to describe this error
    java.lang.Throwable getCause()  
    java.lang.String getMessage()
    Returns the detail message string of this error.
    void setBugText​(java.lang.String msg)
    Sets the bug text to describe this error
    java.lang.String toString()
    Returns a String representation of this class by calling getMessage().

    Methods inherited from class java.lang.Throwable

    addSuppressed, fillInStackTrace, 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

    • GroovyBugError

      public GroovyBugError​(java.lang.String message)
      constructs a bug error using the given text
      Parameters:
      message - the error message text
    • GroovyBugError

      public GroovyBugError​(java.lang.Exception exception)
      Constructs a bug error using the given exception
      Parameters:
      exception - cause of this error
    • GroovyBugError

      public GroovyBugError​(java.lang.String msg, java.lang.Exception exception)
      Constructs a bug error using the given exception and a text with additional information about the cause
      Parameters:
      msg - additional information about this error
      exception - cause of this error
  • Method Details

    • toString

      public java.lang.String toString()
      Returns a String representation of this class by calling getMessage().
      Overrides:
      toString in class java.lang.Throwable
      See Also:
      getMessage()
    • getMessage

      public java.lang.String 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: "
      Overrides:
      getMessage in class java.lang.Throwable
      Returns:
      the detail message string of this error.
    • getCause

      public java.lang.Throwable getCause()
      Overrides:
      getCause in class java.lang.Throwable
    • getBugText

      public java.lang.String getBugText()
      Returns the bug text to describe this error
    • setBugText

      public void setBugText​(java.lang.String msg)
      Sets the bug text to describe this error