Author: mvidner Date: Mon Mar 31 16:36:47 2008 New Revision: 45892
URL: http://svn.opensuse.org/viewcvs/yast?rev=45892&view=rev Log: Trap Perl exceptions so that simple bugs don't kill the whole YaST (FATE 412).
Modified: trunk/perl-bindings/VERSION trunk/perl-bindings/package/yast2-perl-bindings.changes trunk/perl-bindings/src/YPerl.cc
Modified: trunk/perl-bindings/VERSION URL: http://svn.opensuse.org/viewcvs/yast/trunk/perl-bindings/VERSION?rev=45892&a... ============================================================================== --- trunk/perl-bindings/VERSION (original) +++ trunk/perl-bindings/VERSION Mon Mar 31 16:36:47 2008 @@ -1 +1 @@ -2.16.4 +2.16.5
Modified: trunk/perl-bindings/package/yast2-perl-bindings.changes URL: http://svn.opensuse.org/viewcvs/yast/trunk/perl-bindings/package/yast2-perl-... ============================================================================== --- trunk/perl-bindings/package/yast2-perl-bindings.changes (original) +++ trunk/perl-bindings/package/yast2-perl-bindings.changes Mon Mar 31 16:36:47 2008 @@ -1,4 +1,11 @@ ------------------------------------------------------------------- +Mon Mar 31 16:36:21 CEST 2008 - mvidner@suse.cz + +- Trap Perl exceptions so that simple bugs don't kill the whole YaST + (FATE 412). +- 2.16.5 + +------------------------------------------------------------------- Wed Mar 12 14:46:56 CET 2008 - mvidner@suse.cz
- adapt testsuite results to latest debug output again
Modified: trunk/perl-bindings/src/YPerl.cc URL: http://svn.opensuse.org/viewcvs/yast/trunk/perl-bindings/src/YPerl.cc?rev=45... ============================================================================== --- trunk/perl-bindings/src/YPerl.cc (original) +++ trunk/perl-bindings/src/YPerl.cc Mon Mar 31 16:36:47 2008 @@ -285,8 +285,10 @@ string full_name = module + "::" + function; int ret_count = 0;
+ // G_EVAL: prevent errors from making Perl (and the rest of YaST) die + // (FATE 412) // so far we use static methods, so call_pv is enough - ret_count = call_pv( full_name.c_str(), calling_context ); + ret_count = call_pv( full_name.c_str(), calling_context | G_EVAL);
// @@ -295,6 +297,13 @@
SPAGAIN; // Copy global stack pointer to local one
+ // if the eval catches an exception, undef is returned + // and we check $@ (ERRSV) + if (SvTRUE(ERRSV)) + { + ycp2error ("Perl wanted to die: %s", SvPV_nolen(ERRSV)); + } + YCPValue result = fromPerlScalar (POPs, wanted_result_type);
// If we called it with G_ARRAY, we would have to pop all return
yast-commit@lists.opensuse.org