rakelib/lib/core/include/swigdirector.inc in wxruby3-1.2.1 vs rakelib/lib/core/include/swigdirector.inc in wxruby3-1.3.0
- old
+ new
@@ -186,36 +186,54 @@
: DirectorException(rb_eTypeError, "SWIG director type mismatch", msg)
{}
DirectorTypeMismatchException(VALUE self, const char *method, VALUE error, const char *msg="");
- static inline void raise(VALUE error, const char *msg)
- {
- throw DirectorTypeMismatchException(error, msg);
- }
+ static void raise(VALUE error, const char *msg);
- static inline void raise(const char *msg)
- {
- throw DirectorTypeMismatchException(msg);
- }
+ static void raise(const char *msg);
- static inline void raise(VALUE self, const char* method, VALUE error, const char *msg)
+ static void raise(VALUE self, const char* method, VALUE error, const char *msg);
+
+ private:
+ static void print(const DirectorTypeMismatchException& ex)
{
- throw DirectorTypeMismatchException(self, method, error, msg);
+ VALUE bt = rb_eval_string("caller");
+ bt = rb_funcall(bt, rb_intern("join"), 1, rb_str_new2("\n\tfrom "));
+ std::cerr << std::endl
+ << ' ' << ex.getMessage() << '(' << rb_class2name(ex.getType()) << ')' << std::endl
+ << "\tfrom " << StringValuePtr(bt) << std::endl << std::endl;
}
};
-
DirectorTypeMismatchException::DirectorTypeMismatchException(VALUE self, const char *method, VALUE error, const char *msg)
: DirectorException(Qnil)
{
this->swig_msg = "SWIG director type mismatch ";
this->swig_msg += msg;
this->swig_msg += " returned from ";
this->swig_msg += rb_class2name(CLASS_OF(self));
this->swig_msg += "#";
this->swig_msg += method;
this->setup_error(rb_eTypeError);
+ }
+
+ void DirectorTypeMismatchException::raise(VALUE error, const char *msg)
+ {
+ print(DirectorTypeMismatchException(error, msg));
+ ::exit(254);
+ }
+
+ void DirectorTypeMismatchException::raise(const char *msg)
+ {
+ print(DirectorTypeMismatchException(msg));
+ ::exit(254);
+ }
+
+ void DirectorTypeMismatchException::raise(VALUE self, const char* method, VALUE error, const char *msg)
+ {
+ print(DirectorTypeMismatchException(self, method, error, msg));
+ ::exit(254);
}
/* Any Ruby exception that occurs during a director method call */
class WXRB_EXPORT_FLAG DirectorMethodException : public DirectorException
{