Author: sh-sh-sh Date: Fri Jul 13 15:01:03 2007 New Revision: 39399 URL: http://svn.opensuse.org/viewcvs/yast?rev=39399&view=rev Log: improved error handling Modified: branches/tmp/sh/mod-ui/core/libyui/src/YUI_builtins.cc Modified: branches/tmp/sh/mod-ui/core/libyui/src/YUI_builtins.cc URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/sh/mod-ui/core/libyui/src/YUI_builtins.cc?rev=39399&r1=39398&r2=39399&view=diff ============================================================================== --- branches/tmp/sh/mod-ui/core/libyui/src/YUI_builtins.cc (original) +++ branches/tmp/sh/mod-ui/core/libyui/src/YUI_builtins.cc Fri Jul 13 15:01:03 2007 @@ -800,9 +800,9 @@ YUI_CAUGHT( exception ); // Delete this half-created dialog: - // Some widgets are in a very undefined state (no children etc.) + // Some widgets are in a very undefined state (no children etc.) YDialog::deleteTopmostDialog(); - + ycperror( "UI::OpenDialog(): Dialog term parse error" ); } } @@ -922,7 +922,7 @@ // Try again with the known special cases success = YCPPropertyHandler::setComplexProperty( widget, propertyName, newValue ); } - + ret = YCPBoolean( success ); } catch( YUIPropertyException & exception ) @@ -1641,25 +1641,30 @@ */ YCPValue YUI::evaluateRunPkgSelection( const YCPValue & value_id ) { - if ( ! YCPDialogParser::isSymbolOrId( value_id ) ) + YCPValue result = YCPNull(); + + try { - y2error( "RunPkgSelection(): expecting `id( ... ), not '%s'", value_id->toString().c_str() ); - return YCPNull(); - } + if ( ! YCPDialogParser::isSymbolOrId( value_id ) ) + { + y2error( "RunPkgSelection(): expecting `id( ... ), not '%s'", value_id->toString().c_str() ); + return YCPNull(); + } - YCPValue id = YCPDialogParser::parseIdTerm( value_id ); - YWidget * selector = YCPDialogParser::findWidgetWithId( id ); + YCPValue id = YCPDialogParser::parseIdTerm( value_id ); + YWidget * selector = YCPDialogParser::findWidgetWithId( id ); - if ( ! selector ) + // call overloaded method from specific UI + result = runPkgSelection( selector ); + } + catch ( YUIException & exception ) { - y2error( "RunPkgSelection(): No PackageSelector widget with ID '%s'", - id->toString().c_str() ); - - return YCPVoid(); + YUI_CAUGHT( exception ); + ycperror( "RunPkgSelection() failed" ); + YDialog::currentDialog()->dumpWidgetTree(); } - // call overloaded method from specific UI - return runPkgSelection( selector ); + return result; } -- To unsubscribe, e-mail: yast-commit+unsubscribe@opensuse.org For additional commands, e-mail: yast-commit+help@opensuse.org