Mailinglist Archive: yast-devel (80 mails)

< Previous Next >
Re: [yast-devel] Ruby-bindings and exception
On Tue, 14 Feb 2012 17:27:31 +0100
Ladislav Slezak <lslezak@xxxxxxx> wrote:

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.


That sounds interesting. I just need to clarify two questions here:

1) you control Pkg...but ruby bindings doesn't control module written
in Ruby, so we should use some specific to not overwrite module
method...maybe LastException is good enough.

2) what you include in LastErrorDetails? backtrace? Does anyone use it?

Josef


--

Ladislav Slez√°k
Appliance department / YaST Developer
Lihovarsk√° 1060/12
190 00 Prague 9 / Czech Republic
tel: +420 284 028 960
lslezak@xxxxxxxx
SUSE



--
Josef Reidinger
Software Engineer Appliance Department

SUSE LINUX, s. r. o.
Lihovarska 1060/12
190 00 Praha 9
Czech Republic

jreidinger@xxxxxxxx
SUSE
--
To unsubscribe, e-mail: yast-devel+unsubscribe@xxxxxxxxxxxx
To contact the owner, e-mail: yast-devel+owner@xxxxxxxxxxxx

< Previous Next >
Follow Ups