yell louder on error when parsing scripts
This commit is contained in:
@@ -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
|
||||||
|
|||||||
Reference in New Issue
Block a user