ext/nmatrix/data/data.cpp in nmatrix-0.1.0.rc3 vs ext/nmatrix/data/data.cpp in nmatrix-0.1.0.rc4

- old
+ new

@@ -28,10 +28,11 @@ /* * Standard Includes */ #include <ruby.h> +#include <stdexcept> /* * Project Includes */ @@ -85,11 +86,11 @@ "sinh", "cosh", "tanh", "asinh", "acosh", "atanh", "exp", "log2", "log10", "sqrt", "erf", "erfc", "cbrt", "gamma", - "negate" + "negate", "floor", "ceil" }; } // end of namespace nm extern "C" { @@ -260,10 +261,16 @@ case RATIONAL128: return RubyObject(*reinterpret_cast<Rational128*>(val)); default: - throw; + try { + throw std::logic_error("Cannot create ruby object"); + } + catch (std::logic_error err) { + printf("%s\n", err.what()); + } + rb_raise(nm_eDataTypeError, "Conversion to RubyObject requested from unknown/invalid data type (did you try to convert from a VALUE?)"); } return Qnil; }