GE Lua Documentation

Press F to search!

pcall

Definition


-- @/=[C]:-1
function pcall(...)

Callers

@/lua/ge/extensions/editor/api/gui.lua
  local function testOddImColor() mOddColor = mOddColor.Value end
  local status, msg = pcall(testOddImColor)
  if not status then
    local function testOddImVec4() local tmp = mOddColor.x end
    status, msg = pcall(testOddImVec4)
    if not status then return end
  local function testEvenImColor() mEvenColor = mEvenColor.Value end
  status, msg = pcall(testEvenImColor)
  if not status then
    local function testEvenImVec4() local tmp = mEvenColor.x end
    status, msg = pcall(testEvenImVec4)
    if not status then return end
@/lua/ge/extensions/tech/techCore.lua
  if func then
    status, err = pcall(func)
    if not status then
@/lua/common/jbeam/expressionParser.lua
    --execute the loaded code in protected mode to catch any non syntax errors
    local success, result = pcall(exprFunc)
    if not success then
@/lua/common/quadtree.lua

if not pcall(require, "table.new") then
  table.new = function() return {} end
@/lua/common/mathlib.lua

local _, ffi = pcall(require, 'ffi')
if ffi then
  local ok
  ok, newLuaVec3xyz = pcall(ffi.typeof, "struct __luaVec3_t")
  if not ok then
@/lua/ge/extensions/editor/util/vehicleFilterUtil.lua
  if not configListGenerator then
    local success, result = pcall(function()
      return require('/lua/ge/extensions/util/configListGenerator')
@/lua/common/lpack.lua

if not pcall(require, "table.clear") then
  table.clear = function(tab) for k, _ in ipairs(tab) do tab[k] = nil end end

if not pcall(require, "table.new") then
  table.new = function() return {} end

local ffifound, ffi = pcall(require, 'ffi')
if not ffifound then
@/lua/console/test.lua
            if content ~= nil then
                local state, parts = pcall(json.decode, content)
                if state == false then
@/lua/ge/extensions/editor/vehicleEditor/staticEditor/veJBeamSpellchecker.lua
  if content then
    local ok, data = pcall(json.decode, content)
    if ok == false then
@/lua/ge/extensions/gameplay/missions/missions.lua
    if gameplay_missions_missions.getMissionEditorForType(mission.missionType).calculateMissionIssues then
      local success, customIssues = pcall(gameplay_missions_missions.getMissionEditorForType(mission.missionType).calculateMissionIssues, mission)
      if success then
@/lua/common/jbeam/io.lua
  if plainFileContent then
    local ok, data = pcall(json.decode, plainFileContent)
    if ok == false then
@/lua/common/tech/techCommunication.lua
  if not tcomDebug then
    local status, result = pcall(handler, request)
    if status then
@/lua/common/libs/LuLPeg/lulpeg.lua
    noglobals = function()
        pcall(setfenv, 3, env)
    end
function util.checkstring(s, func)
    local success, str = pcall(_checkstrhelper, s)
    if not success then 
            char = i
            success, offset = pcall(utf8_offset, b)
            if not success then return false, char - 1 end
    local success
    success, n = pcall(tonumber, n)
    assert(success and type(n) == "number",
    , "locale", "printers", "re" }))
local _, package = pcall(require, "package")
local _ENV = u.noglobals() ----------------------------------------------------
local function register(self, env)
    pcall(function()
        package.loaded.lpeg = self
local _, debug, jit
_, debug = pcall(require, "debug")
_, jit = pcall(require, "jit")
_, debug = pcall(require, "debug")
_, jit = pcall(require, "jit")
jit = _ and jit
    lua52_len = not #setmetatable({},{__len = function()end}),
    proxies = pcall(function()
        local prox = newproxy(true)
@/lua/ge/extensions/c2/webSocketHandler.lua
    if extName then
      local ok, err = pcall(extensions.load, extName)
      if not ok then
      else
        local ok, decodedMsg = pcall(jsonDecode, evt.msg)
        if ok and decodedMsg then
@/lua/ge/map.lua

  local state, jsonMap = pcall(json.decode, content)
  if state == false then
@/lua/vehicle/extensions/tech/techCore.lua
  if func then
    status, err = pcall(func)
    if not status then
@/lua/ge/extensions/freeroam/specialTriggers.lua
        local fx = load(trigger.enterCommand)
        if fx then pcall(fx) end
      end
        local fx = load(trigger.exitCommand)
        if fx then pcall(fx) end
      end
@/lua/ge/extensions/editor/vehicleEditor/staticEditor/veJBeamTableVis.lua
  if content then
    local ok, data = pcall(json.decode, content)
    if ok == false then
@/lua/ge/extensions/editor/fileDialog.lua
local function execCB(data)
  local isok, msg = pcall(callbackFunction, data)
  if not isok then
@/lua/common/json.lua

if not pcall(require, "table.new") then
  table.new = function() return {} end

if not pcall(require, "table.clear") then
  table.clear = function() return {} end
@/lua/ge/extensions/flowgraph/nodes/scene/customLuaCommand.lua
    local functionToExecute = loadstring(self.pinIn.func.value)
    local status, ret = pcall(functionToExecute)
    self.pinOut.flow.value = status
@/lua/common/libs/resty/template/microbenchmark.lua

local ok, new_tab = pcall(require, "table.new")
if not ok then
@/lua/vehicle/main.lua
    profilerPushEvent("deserialize")
    local state, initData = pcall(lpack.decode, initData)
    profilerPopEvent("deserialize")
@/lua/ge/extensions/editor/gen/test.lua
--			lo('?? test_if_build:'..tableSize(adesc)..':'..tableSize(levelMaterialNames)..':'..tostring(matobj))
--		local ffifound, ffi = pcall(require, 'ffi')
--		local nwlib = ffi.load("nwlib.dll")
@/lua/ge/extensions/core/input/bindings.lua
      local success
      success, fileData = pcall(json.decode, f)
      if not success then
  local ffbConfigString = be:getFFBConfig(FFBID)
  local state, ffbConfig = pcall(json.decode, ffbConfigString)
  if state == false then
  end
  local state, ffbParams = pcall(json.decode, ffbConfig.ffbParamsJson)
  if state ~= true then
@/lua/ge/extensions/c2/panelPlugins/vehicleManager.lua
    if next(dataToSend) then
       pcall(function() activeServer:sendData(peerId, jsonEncode(dataToSend)) end)
    end
@/lua/ge/extensions/editor/vehicleEditor/staticEditor/vePartTextView.lua
    oldPartName = partName
    success, oldResult = pcall(function() return {jbeamIO.getPart(ioCtx, partName)} end)
    if not success then return end
@/lua/objectpool/main.lua
  if type(initData) == "string" and string.len(initData) > 0 then
    local state, initData = pcall(lpack.decode, initData)
    if state and type(initData) == "table" then
@/lua/ge/extensions/util/nodeStream.lua
    if extName then
      local ok, err = pcall(extensions.load, extName)
      if not ok then
      else
        local ok, decodedMsg = pcall(jsonDecode, evt.msg)
        if ok and decodedMsg then
@/lua/ge/extensions/flowgraph/nodes/math/math.lua
    local success
    success, result = pcall(self.expressionFunc)
    if not success then
@/lua/ge/extensions/editor/crawlEditor/paths.lua
    if flagsEditEnded[0] then
      local ok, decoded = pcall(function(s)
        return (json and json.decode and json.decode(s)) or {}
@/lua/ge/extensions/gameplay/drag/saveSystem.lua

  local success, error = pcall(function()
    jsonWriteFile(filePath, facilities, true)
@/lua/common/utils.lua

local ffifound, ffi = pcall(require, 'ffi')
if not ffifound then
@/lua/ge/extensions/ui/console.lua
local function checkPattern(pat)
  local status,err = pcall(function() string.match("", pat) end )
  if not status then filterErr = string.match(tostring(err), "%[.*%]:%d*: ?(.*)") end
    else --origin filter
      local s,r = pcall(function() return item[3]:lower():match(originFilter) end)
      if s then
@/lua/console/json-performance.lua
  --print(' * ' ..tostring(filename))
  local state, data = pcall(json.decode, content)
  luaContent[filename] = data
@/lua/common/utils/debugDraw.lua

local ffifound, ffi = pcall(require, 'ffi')
if not ffifound then
@/lua/ge/extensions/editor/buildingEditor.lua

--local ffifound, ffi = pcall(require, 'ffi')
@/lua/common/libs/lua-MessagePack/MessagePack.lua
      if cursor.i > cursor.j then
        pcall(cursor.underflow, cursor, cursor.i)
      end
@/lua/ge/extensions/editor/gen/decal.lua
--local ffi = require("ffi")
--local ffifound, ffi = pcall(require, 'ffi')
--if not ffifound then
@/lua/ge/extensions/flowgraph/nodes/logic/booleanExpression.lua
    local success
    success, result = pcall(self.expressionFunc)
    if not success then
@/lua/ge/extensions/gameplay/rally/tools/loopToolbox.lua

    local objName = pcall(function() return obj:getName() end) and obj:getName() or "unnamed"
    local objShapeName = pcall(function() return obj.shapeName end) and obj.shapeName or ""
    local objName = pcall(function() return obj:getName() end) and obj:getName() or "unnamed"
    local objShapeName = pcall(function() return obj.shapeName end) and obj.shapeName or ""
    local objClassName = pcall(function() return obj:getClassName() end) and obj:getClassName() or "unknown"
    local objShapeName = pcall(function() return obj.shapeName end) and obj.shapeName or ""
    local objClassName = pcall(function() return obj:getClassName() end) and obj:getClassName() or "unknown"
    local flagValue = ""
    local success, dynFields = pcall(function() return obj:getDynamicFields() end)
    if success and dynFields then
      if not objPos then
        local transformSuccess, transform = pcall(function() return obj:getTransform() end)
        if transformSuccess and transform then
      if not objPos then
        local posFieldSuccess, posField = pcall(function() return obj:getField("position", "") end)
        if posFieldSuccess and posField and posField ~= "" then
      -- First try size() method
      local success1, result1 = pcall(function() return obj:size() end)
      if success1 and result1 then
        -- Try getCount() method (used by SimGroup)
        local success2, result2 = pcall(function() return obj:getCount() end)
          if useSimGroupMethods then
            childSuccess, child = pcall(function() return obj:getObject(i) end)
          else
          else
            childSuccess, child = pcall(function() return obj:at(i) end)
          end
  for _, signboard in ipairs(self.signboards) do
    local success = pcall(function()
      -- Verify object still exists
@/lua/ge/extensions/editor/gen/lib/jbeam.lua
    if content then
        local ok, data = pcall(json.decode, content)
        if ok == false then
@/lua/ge/extensions/util/jbeamStats.lua
    if content ~= nil then
        local state, parts = pcall(json.decode, content)
        if state ~= false then
@/lua/common/luaCore.lua
function require_optional(module)
  local ok, m = pcall(require, module)
  if ok then return m end

if not pcall(require, "table.clear") then
  table.clear = function(tab) for k, _ in pairs(tab) do tab[k] = nil end end

if not pcall(require, "table.new") then
  table.new = function() return {} end
@/lua/ge/extensions/editor/mainToolbar.lua
  if FS:fileExists(settingsPath) then
    local success, data = pcall(jsonReadFile, settingsPath)
    if success and data and type(data) == "table" and data.sets and type(data.sets) == "table" then
@/lua/ge/extensions/flowgraph/graph.lua
      --execute the loaded code in protected mode to catch any non syntax errors
      local success, result = pcall(exprFunc)
      if not success then
@/lua/common/libs/lua-websockets/websocket/tools.lua
local sha1_crypto
local done,crypto = pcall(require,'crypto')
if done then
@/lua/common/jsonDebug.lua

if not pcall(require, "table.new") then
  table.new = function() return {} end

if not pcall(require, "table.clear") then
  table.clear = function() return {} end
@/lua/ge/extensions/freeroam/freeroamConfigurator.lua
  local details = {}
  local success = pcall(function()
    ui_gameplaySelector_tileGenerators_levelTiles.onGameplaySelectorGetDetails(

  local success, vehicleDetails = pcall(function()
    return ui_vehicleSelector_detailsInteraction.getDetails({model = model, config = config})
@/lua/ge/extensions/core/vehicle/manager.lua
    if vehicleObj and vehicleObj.getMeshCacheRebuildSummary then
      local ok, summary = pcall(function() return vehicleObj:getMeshCacheRebuildSummary() end)
      if ok and type(summary) == 'table' then meshCacheSummary = summary end
@/lua/ge/client/parseArgs.lua
      elseif arg == "-tcom" or arg == "-tcom-capture" then
        local success, err = pcall(function()
          extensions.load('tech/techCore')
@/lua/ge/extensions/core/modmanager.lua
  for k,v in ipairs(modScriptFiles) do
    local status, ret = pcall(dofile, v)
    if not status then
  for k,v in ipairs(modScriptFiles) do
    if not pcall(dofile, v) then
      log('E', 'initDB.modScript', 'Failed to execute ' .. v)
  for k,v in ipairs(modScripts) do
    local status, ret = pcall(dofile, v)
    if not status then
  for k,v in ipairs(modScripts) do
    local status, ret = pcall(dofile, v)
    if not status then
@/lua/ge/extensions/c2/panelPlugins/tileManager.lua
    if data then
      local status, encoded = pcall(jsonEncode, {
        type = "sceneTileData",
@/lua/ge/extensions/gameplay/rally/notebook/pacenote.lua
    setfenv(func, context)
    local status, result = pcall(func, context)
    if status then
@/lua/vehicle/controller.lua
  end
  local result, errorStr = pcall(loadFunc)
  if not result then
    end
    local result, errorStr = pcall(loadFunc)
    if not result then
@/lua/ge/extensions/core/flowgraphManager.lua

      local status, node = pcall(rerequire, requireFilename)
      if not status then
@/lua/common/libs/lua-websockets/websocket/bit.lua
local has_bit32,bit = pcall(require,'bit32')
if has_bit32 then
@/lua/common/libs/luamqtt/mqtt/protocol5.lua
			-- make property data
			local ok, val = pcall(property_make[prop_id], value)
			if not ok then
@/lua/common/libs/LuaIRC/init.lua
    if secure then
        local work, ssl = pcall(require, "libs/luasec/ssl")
        if not work then
@/lua/common/libs/timerwheel/timerwheel.lua
else
  local ok, socket = pcall(require, "socket")
  if ok then

local ok, new_tab = pcall(require, "table.new")
if not ok then
@/lua/common/tcpServer.lua
  if not createNetworkServer then
    local status, err = pcall(function()
      self.serverLuasocket = socket.bind(listenHost, port)
@/lua/ge/extensions/flowgraph/nodes/util/customLua.lua
  if self.compiled[code] then
    local status, err, res = pcall(self.compiled[code], debug.traceback)
    if not status then
@/lua/common/jbeam/variables.lua
        if secondChar == 61 then -- =
          local ok, res = pcall(expressionParser.parse, v, vars)
          if ok then
@/lua/ge/extensions/core/settings/settings.lua
    data.userColorPresets = data.userColorPresets:gsub("'", '"') -- replace ' with "
    local ok, userColorPresets = pcall(json.decode, data.userColorPresets)
    if ok then
@/lua/common/libs/resty/template.lua

local ok, newtab = pcall(require, "table.new")
if not ok then newtab = function() return {} end end
@/lua/ge/main.lua
  -- deserialize extensions first, so the extensions are loaded before they are trying to get deserialized
  local ok, data = pcall(deserialize, s)
  if not ok then
@/lua/common/luaBinding.lua
  assert(a.strB == 'abc')
  assert(pcall(function() a:callC() end) == true)

  --assert(pcall(function() tc.strC = 'test' end) == false) -- this will fail as tc is declared as const
  --assert(pcall(function() tc:callA() end) == false) -- will not work as the function is not const
  --assert(pcall(function() tc.strC = 'test' end) == false) -- this will fail as tc is declared as const
  --assert(pcall(function() tc:callA() end) == false) -- will not work as the function is not const
  --assert(pcall(function() tc:callC() end) == true) -- will work as the fucntion is declared as const: void callC() const;
  --assert(pcall(function() tc:callA() end) == false) -- will not work as the function is not const
  --assert(pcall(function() tc:callC() end) == true) -- will work as the fucntion is declared as const: void callC() const;
@/lua/common/utils/torqueScriptParser.lua
local function parse(s)
  return pcall(epnf.parsestring, pg, s)
  --local ok, ast = pcall(epnf.parsestring, pg, s)
  return pcall(epnf.parsestring, pg, s)
  --local ok, ast = pcall(epnf.parsestring, pg, s)
  --if ok then
@/lua/ge/extensions/flowgraph/manager.lua
    local requireFilename = string.sub(filename, 1, string.len(filename) - 4)
    local status, node = pcall(rerequire, requireFilename)
    if not status then
@/lua/common/libs/copas/copas/limit.lua
      copas.sleep(-1)                            -- go to sleep until being woken
      local suc, err = pcall(task, unpack(carg)) -- start the task
      self:removethread(coroutine.running())           -- dismiss ourselves
@/lua/ge/extensions/editor/missionEditor/genericTypeData.lua
  if gameplay_missions_missions.getMissionEditorForType(m.missionType).calculateMissionIssues then
    local success, customIssues = pcall(gameplay_missions_missions.getMissionEditorForType(m.missionType).calculateMissionIssues, m)
    if success then
@/lua/common/libs/StackTracePlus/StackTracePlus.lua
local function add_known_module(name, desc)
  local ok, mod = pcall(require, name)
  if ok then
  end
  local ok, err = pcall(tostring, value)
  if ok then return err else return (": '%s'"):format(err) end
@/lua/ge/extensions/editor/vehicleEditor/staticEditor/vePartTree.lua
  local ioCtx = vEditor.vehData.ioCtx
  local success, result = pcall(function() return {jbeamIO.getPart(ioCtx, partName)} end)
  if not success then return end
@/lua/ge/extensions/editor/vehicleEditor/staticEditor/veJBeamVariablesChecker.lua
  if content then
    local ok, data = pcall(json.decode, content)
    if ok == false then