Mailinglist Archive: yast-devel (101 mails)

< Previous Next >
Re: [yast-devel] libyui throwing exceptions
  • From: Stefan Hundhammer <sh@xxxxxxx>
  • Date: Tue, 8 Jan 2008 13:27:08 +0100
  • Message-id: <200801081327.08295.sh@xxxxxxx>
On Tuesday 08 January 2008 13:17, Klaus Kaempf wrote:
* Stefan Hundhammer <sh@xxxxxxx> [Jan 08. 2008 13:08]:
Any ideas how to handle this better?

In any case, a proper user information is obligatory.
Crashing is not an option.

Well, it's no more crashing than the other way. Just read what I just wrote
about that "No dialog existing" popup. The application is dead in either
case.

Whats wrong with defining a return value (and actually checking it ;-)) for
OpenDialog() (and similar functions currently raising exceptions) ?

Have you EVER seen any piece of code that actually checks the return values
for any of those calls? Look through our code. There are no such checks.

And even if there were, what would you expect to happen? Do you think it is
realistic to add error handling code for UI syntax errors to all the places
where it might happen?


bool success = UI::OpenDialog(`VBox(`HBox(...), `HBox(...), ... );

if ( ! success )
{
// We just messed up the dialog. Handle this self-made error.

bool success = UI::OpenDialog(`Label("We just made a syntax error"),
`PushButton("OK") );

if ( ! success )
{
// Handle possible errors of the error handling code

// Duh. Another OpenDialog() that might fail.
// We just opened an endless recursion.
}
}


Can the control-center check exit codes and display a proper error
message ?

Did you never see that "xmessage" window that no user likes (because it's
always bad news)?


CU
--
Stefan Hundhammer <sh@xxxxxxx> Penguin by conviction.
YaST2 Development
SUSE LINUX Products GmbH, GF: Markus Rex, HRB 16746 (AG Nürnberg)
Nürnberg, Germany
--
To unsubscribe, e-mail: yast-devel+unsubscribe@xxxxxxxxxxxx
For additional commands, e-mail: yast-devel+help@xxxxxxxxxxxx

< Previous Next >
Follow Ups