Top Description Constructors Methods
org.jruby.exceptions

public Class Exception

extends RaiseException
Class Inheritance
Known Direct Subclasses
org.jruby.exceptions.Fatal, org.jruby.exceptions.NoMemoryError, org.jruby.exceptions.ScriptError, org.jruby.exceptions.SecurityError, org.jruby.exceptions.SignalException, org.jruby.exceptions.StandardError, org.jruby.exceptions.SystemExit, org.jruby.exceptions.SystemStackError
Imports
org.jruby.RubyException, org.jruby.javasupport.JavaUtil

Represents a Ruby Exception as a throwable Java exception.
See Also
RubyException

Constructor Summary

AccessConstructor and Description
public
Exception(String message, RubyException exception)

Method Summary

Modifier and TypeMethod and Description
public synchronized Throwable
initCause(Throwable
the cause (which is saved for later retrieval by the getCause() method). (A null value is permitted, and indicates that the cause is nonexistent or unknown.)
cause
)

Overrides java.lang.Throwable.initCause.

Initializes the cause of this throwable to the specified value.

Inherited from org.jruby.exceptions.RaiseException:
createNativeRaiseExceptioncreateNativeRaiseExceptionfillInStackTracefromfromfromfromfromfromfromgetCausegetExceptiongetMessagejavaTraceFromRubyTracesetExceptionsetException

Constructor Detail

Exceptionback to summary
public Exception(String message, RubyException exception)

Method Detail

initCauseback to summary
public synchronized Throwable initCause(Throwable cause)

Overrides java.lang.Throwable.initCause.

Doc from java.lang.Throwable.initCause.

Initializes the cause of this throwable to the specified value. (The cause is the throwable that caused this throwable to get thrown.)

This method can be called at most once. It is generally called from within the constructor, or immediately after creating the throwable. If this throwable was created with Throwable(Throwable) or Throwable(String, Throwable), this method cannot be called even once.

An example of using this method on a legacy throwable type without other support for setting the cause is:

try {
    lowLevelOp();
} catch (LowLevelException le) {
    throw (HighLevelException)
          new HighLevelException().initCause(le); // Legacy constructor
}
Parameters
cause:Throwable

the cause (which is saved for later retrieval by the getCause() method). (A null value is permitted, and indicates that the cause is nonexistent or unknown.)

Returns:Throwable

a reference to this Throwable instance.

Annotations
@Override