Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Apr 1, 2010, 1:46:53 PM (14 years ago)
Author:
rgrieder
Message:

Lua errors in 'doFile', 'includeFile' or 'require' should not be caught in theses functions but rather at the beginning of the Lua call.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • code/branches/gamestates2/src/libraries/core/LuaState.cc

    r6667 r6670  
    201201        case LUA_ERRMEM:    // Memory allocation error
    202202            COUT(1) << "Lua memory allocation error: Consult your dentist immediately!" << std::endl;
    203             lua_pop(luaState_, 1); // Remove error message
    204203            break;
    205204        }
     
    213212            {
    214213            case LUA_ERRRUN: // Runtime error
    215                 // Remove error string from stack (we already display the error in the
     214                // Do nothing (we already display the error in the
    216215                // 'errorHandler' Lua function in LuaStateInit.lua)
    217216                break;
     
    223222                break;
    224223            }
    225             if (error != 0)
    226                 lua_pop(luaState_, 1); // Remove error message
    227224        }
    228225
    229226        if (error != 0)
     227        {
     228            lua_pop(luaState_, 1);  // Remove error message
    230229            lua_pushnil(luaState_); // Push a nil return value
     230        }
    231231
    232232        if (errorHandler != 0)
Note: See TracChangeset for help on using the changeset viewer.