yell louder on error when parsing scripts

This commit is contained in:
Chris Danford
2005-02-12 22:53:51 +00:00
parent 1bd60eb3fb
commit e38164e74f
+5 -2
View File
@@ -230,14 +230,16 @@ bool LuaManager::RunScriptFile( const CString &sFile )
RageFile f; RageFile f;
if( !f.Open( sFile ) ) if( !f.Open( sFile ) )
{ {
LOG->Warn( "Couldn't open Lua script \"%s\": %s", sFile.c_str(), f.GetError().c_str() ); CString sError = ssprintf( "Couldn't open Lua script \"%s\": %s", sFile.c_str(), f.GetError().c_str() );
Dialog::OK( sError, "LUA_ERROR" );
return false; return false;
} }
CString sScript; CString sScript;
if( f.Read( sScript ) == -1 ) if( f.Read( sScript ) == -1 )
{ {
LOG->Warn( "Error reading Lua script \"%s\": %s", sFile.c_str(), f.GetError().c_str() ); CString sError = ssprintf( "Error reading Lua script \"%s\": %s", sFile.c_str(), f.GetError().c_str() );
Dialog::OK( sError, "LUA_ERROR" );
return false; return false;
} }
@@ -280,6 +282,7 @@ bool LuaManager::RunScript( const CString &sScript, int iReturnValues )
return true; return true;
} }
bool LuaManager::RunExpression( const CString &str ) bool LuaManager::RunExpression( const CString &str )
{ {
// load string // load string