On Tuesday 08 January 2008 13:17, Klaus Kaempf wrote:
* Stefan Hundhammer
[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