On Donnerstag, 4. September 2008, Ladislav Slezak wrote:
> My question is why is the failed check considered as a fatal error? Isn't
> it rather a minor problem? Would be an y2warning message enough instead of
> aborting the module?

It doesn't abort the module; it makes UI::OpenDialog() fail. You could easily 
catch that in YCP code (but it's not done anywhere in production code):

http://svn.opensuse.org/svn/yast/trunk/ycp-ui-bindings/examples/ButtonBox2.ycp

    void showDialog( term buttonBox )
    {
        boolean success = (boolean)
            UI::OpenDialog(
                           `VBox(
                                 `HVCenter( `Label( "Hello, World!" ) ),
                                 buttonBox
                                 )
                           );

        // Most YCP developers never use the return value of UI::OpenDialog().
        // Many of them probably don't even know that it has a return value.
        //
        // Used properly, that return value can be used to recover from error
        // situations that would otherwise abort the program - like in this 
        //case.

        if ( success )
        {
            UI::UserInput();
            UI::CloseDialog();
        }
    }


Past experience shows that y2warning() calls are generally ignored, so they 
are pretty useless.


CU
-- 
Stefan Hundhammer <[EMAIL PROTECTED]>                Penguin by conviction.
YaST2 Development
SUSE LINUX Products GmbH, GF: Markus Rex, HRB 16746 (AG Nürnberg)
Nürnberg, Germany
-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to