Dne Po 13. února 2012 19:19:56, Josef Reidinger napsal(a):
Hi YaST hackers, there is problem with exceptions from ruby modules. Now if risen, yast crash. I found this behavior quite annoying and it should be improved. I can do it, question is what is correct behavior. Does anyone have suggestion? In yast++ we have now error variable and catch exceptions. So I can in ruby bindings ( and only in bindings so ruby code is not affected ) extend class by method that return message of last exception. So you can run code as if (Module::run == nil) y2error ("Problem with run %1",Module.yast_error);
I think this is basically only option from YaST side; catch exception in ruby- bindings layer and save some error exception message (just do not call it 'yast_error', better, exception_message or last_error). Who would need to set that variable? YLib? Or could it be set by ruby-bindings from the exception message it catches?
I welcome any other suggestions or comments. Also it would be nice to have uniform way....how python bindings solve such problem?
I do not think it is solved in python-bindings. I've just tested: when exception is raised, YaST logs an error. But it does not crash Jiri -- Jiri Suchomel SUSE LINUX, s.r.o. e-mail: jsuchome@suse.cz Lihovarská 1060/12 tel: +420 284 028 960 190 00 Praha 9, Czech Republic http://www.suse.cz -- To unsubscribe, e-mail: yast-devel+unsubscribe@opensuse.org To contact the owner, e-mail: yast-devel+owner@opensuse.org