The existence of an error is signaled by error_string being nonempty.

This commit is contained in:
Steve Checkoway
2006-10-01 12:39:50 +00:00
parent c89900e2c1
commit d778966fc6
3 changed files with 12 additions and 46 deletions
+4 -11
View File
@@ -11,19 +11,12 @@ bool XmlFileUtil::LoadFromFileShowErrors( XNode &xml, RageFileBasic &f )
PARSEINFO pi;
RString s;
if( f.Read( s ) == -1 )
{
pi.error_occur = true;
pi.error_string = f.GetError();
goto error;
}
else
xml.Load( s, &pi );
if( pi.error_string.empty() )
return true;
xml.Load( s, &pi );
if( pi.error_occur )
goto error;
return true;
error:
RString sWarning = ssprintf( "XML: LoadFromFile failed: %s", pi.error_string.c_str() );
LOG->Warn( sWarning );
Dialog::OK( sWarning, "XML_PARSE_ERROR" );