Dne 14.2.2012 09:57, Lukas Ocilka napsal(a):
On 02/14/2012 09:13 AM, Jiri Suchomel wrote:
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
IMO it would be nice if error was logged anytime an exception is caught by ruby-bindings.
Having the last_error or maybe even last_exception (with details) method would be definitely a good approach.
When pkg-bindings catch an exception from libzypp the invoked Pkg:: call returns nil and Pkg::LastError() and Pkg::LastErrorDetails() return the details about the error. Libzypp exceptions are automatically logged by libzypp when they are thrown (pkg-bindings do not have to do anything special). I think a similar way can be used also in Ruby bindings. -- Ladislav Slezák Appliance department / YaST Developer Lihovarská 1060/12 190 00 Prague 9 / Czech Republic tel: +420 284 028 960 lslezak@suse.com SUSE -- To unsubscribe, e-mail: yast-devel+unsubscribe@opensuse.org To contact the owner, e-mail: yast-devel+owner@opensuse.org