On 25.10.2013 16:34, Josef Reidinger wrote:
Hi, I would like to announce, that new version of ruby bindings (3.1.2) is released. There is two changes:
1. Detect if there is invalid response type from client ( client call using component system, so only simple types are allowed ) - https://github.com/yast/yast-ruby-bindings/issues/81
2. Improved exception handling. Now if exception appear in client, then error message about internal error is shown to user. It using Report.Error so it works good in various cases ( TUI, autoyast, CLI ). After report it works as before, so client return nil and continue. Reason for this change is to reduce number of silent failures and encourage everyone to use exceptions in yast code.
Nice, I also suggest using an error pop-up dialog with additional details and print the backtrace there (if user clicks [Details]) the same way we do it on web.
I think we need some rules for exceptions. My proposel is to use exceptions everywhere and every uncaught exception is bug. This behavior allows us to quickly see problem and do not have current silent failures.
Could you explain a bit further and/or provide some nice example how to use exceptions in Yast? Yes, we need to define what is the correct use for exception, for instance I've seen using trow -> catch (raise -> rescue) used to exit from a deep multi-foreach loop, but that doesn't seem to be nice usage :) Opinions on for what to use exceptions in Yast? Bye Lukas -- Lukas Ocilka, Yast TL, Cloud & Systems Management Department SUSE LINUX s.r.o., Praha -- To unsubscribe, e-mail: yast-devel+unsubscribe@opensuse.org To contact the owner, e-mail: yast-devel+owner@opensuse.org