Search in sources :

Example 16 with RaiseException

use of org.jruby.exceptions.RaiseException in project cuke4duke by cucumber.

the class JRubyExceptionFactory method error.

public Exception error(String errorClass, String message) {
    RubyModule cucumber = JRuby.getRuntime().getModule("Cucumber");
    RubyClass error = cucumber.getClass(errorClass);
    return new RaiseException(JRuby.getRuntime(), error, message, true);
}
Also used : RubyModule(org.jruby.RubyModule) RaiseException(org.jruby.exceptions.RaiseException) RubyClass(org.jruby.RubyClass)

Aggregations

RaiseException (org.jruby.exceptions.RaiseException)16 JRubyMethod (org.jruby.anno.JRubyMethod)8 RubyArray (org.jruby.RubyArray)7 IRubyObject (org.jruby.runtime.builtin.IRubyObject)7 ByteArrayInputStream (java.io.ByteArrayInputStream)4 IOException (java.io.IOException)4 ClosedStreamException (nokogiri.internals.ClosedStreamException)4 RubyException (org.jruby.RubyException)4 IllegalCharsetNameException (java.nio.charset.IllegalCharsetNameException)2 DOMSource (javax.xml.transform.dom.DOMSource)2 XmlDocument (nokogiri.XmlDocument)2 XmlSyntaxError (nokogiri.XmlSyntaxError)2 NokogiriHelpers.nodeArrayToRubyArray (nokogiri.internals.NokogiriHelpers.nodeArrayToRubyArray)2 ClojureTest (org.enumerable.lambda.support.clojure.ClojureTest)2 GroovyTest (org.enumerable.lambda.support.groovy.GroovyTest)2 JavaScriptTest (org.enumerable.lambda.support.javascript.JavaScriptTest)2 LambdaJRuby (org.enumerable.lambda.support.jruby.LambdaJRuby)2 ScalaTest (org.enumerable.lambda.support.scala.ScalaTest)2 Ruby (org.jruby.Ruby)2 RubyProc (org.jruby.RubyProc)2