summaryrefslogtreecommitdiff
path: root/swig
diff options
context:
space:
mode:
Diffstat (limited to 'swig')
-rw-r--r--swig/ruby/ruby.i5
1 files changed, 4 insertions, 1 deletions
diff --git a/swig/ruby/ruby.i b/swig/ruby/ruby.i
index d2d3025..9d5ad5d 100644
--- a/swig/ruby/ruby.i
+++ b/swig/ruby/ruby.i
@@ -111,13 +111,16 @@ namespace zypp
} \
}
+%wrapper {
+ static VALUE zyppexception = rb_define_class("ZYppException", rb_eStandardError);
+}
+
%exception
{
try {
$action
}
catch (const Exception& e) {
- static VALUE zyppexception = rb_define_class("ZYppException", rb_eStandardError);
std::string tmp = e.historyAsString() + e.asUserString();
rb_raise(zyppexception, tmp.c_str());
}