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 [email protected] SUSE -- To unsubscribe, e-mail: [email protected] To contact the owner, e-mail: [email protected]
