Mailinglist Archive: yast-devel (80 mails)

< Previous Next >
Re: [yast-devel] Ruby-bindings and exception
Dne 15.2.2012 13:13, Josef Reidinger napsal(a):

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.

Um, I don't know how actually ruby bindings work, but I think you should catch
the
exceptions at the highest level (in C++) if that's possible...

All calls in pkg-bindings are wrapped in a generic catch(...) which catches all
exceptions (so yast doesn't crash if there is an unknown problem or missing
catch
statement).


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

Um, unfortunately it is currently not used :-(

It could contain libzypp history e.g. DNS name resolving problem -> file FOO
download
failed -> repo refresh failed.

Libzypp history is a kind of backtrace, but suitable for end users (no technical
details like line numbers and function names - this can be found in the log).
Just high level overview what went wrong like in the example above...

But currently the exception history is part of the LastErrorMessage() because
YCP
scripts do not use LastErrorDetails() at all (grep in SVN trunk just found 3
calls
in all yast modules).

After adding libzypp history support to LastErrorDetails() I would had to
change all
YCP code using LastError() to use also LastErrorMessage(). I chose the easier
way and
simply added the history to LastError()...


--

Best Regards

Ladislav Slezák
Yast Developer
------------------------------------------------------------------------
SUSE LINUX, s.r.o. e-mail: lslezak@xxxxxxx
Lihovarská 1060/12 tel: +420 284 028 960
190 00 Prague 9 fax: +420 284 028 951
Czech Republic http://www.suse.cz/
--
To unsubscribe, e-mail: yast-devel+unsubscribe@xxxxxxxxxxxx
To contact the owner, e-mail: yast-devel+owner@xxxxxxxxxxxx

< Previous Next >