Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
38 changes: 18 additions & 20 deletions lua/entities/gmod_wire_expression2/init.lua
Original file line number Diff line number Diff line change
Expand Up @@ -159,19 +159,17 @@ function ENT:Execute(script, context)
if not ok then
local _catchable, msg, trace = E2Lib.unpackException(msg)

if msg == "exit" then
self:UpdatePerf(selfTbl)
elseif msg == "perf" then
local trace = context.trace or trace

if msg == "perf" then
trace = context.trace or trace
self:UpdatePerf(selfTbl)
self:Error("Expression 2 (" .. selfTbl.name .. "): tick quota exceeded (at line " .. trace.start_line .. ", char " .. trace.start_col .. ")", "tick quota exceeded")
elseif trace then
self:Error("Expression 2 (" .. selfTbl.name .. "): Runtime error '" .. msg .. "' at line " .. trace.start_line .. ", char " .. trace.start_col, "script error")
else
local trace = context.trace or trace

self:Error("Expression 2 (" .. selfTbl.name .. "): Internal error '" .. msg .. "' at line " .. trace.start_line .. ", char " .. trace.start_col, "script error")
elseif msg ~= "exit" then
if trace then
self:Error("Expression 2 (" .. selfTbl.name .. "): Runtime error '" .. msg .. "' at line " .. trace.start_line .. ", char " .. trace.start_col, "script error")
else
trace = context.trace or trace
self:Error("Expression 2 (" .. selfTbl.name .. "): Internal error '" .. msg .. "' at line " .. trace.start_line .. ", char " .. trace.start_col, "script error")
end
end
end

Expand Down Expand Up @@ -245,17 +243,17 @@ function ENT:ExecuteEvent(evt, args)
if not ok then
local _catchable, msg, trace = E2Lib.unpackException(msg)

if msg == "exit" then
self:UpdatePerf(selfTbl)
elseif msg == "perf" then
local trace = context.trace
if msg == "perf" then
trace = context.trace
self:UpdatePerf(selfTbl)
self:Error("Expression 2 (" .. selfTbl.name .. "): tick quota exceeded (at line " .. trace.start_line .. ", char " .. trace.start_col .. ")", "tick quota exceeded")
elseif trace then
self:Error("Expression 2 (" .. selfTbl.name .. "): Runtime error '" .. msg .. "' at line " .. trace.start_line .. ", char " .. trace.start_col, "script error")
else
local trace = context.trace
self:Error("Expression 2 (" .. selfTbl.name .. "): Internal error '" .. msg .. "' at line " .. trace.start_line .. ", char " .. trace.start_col, "script error")
elseif msg ~= "exit" then
if trace then
self:Error("Expression 2 (" .. selfTbl.name .. "): Runtime error '" .. msg .. "' at line " .. trace.start_line .. ", char " .. trace.start_col, "script error")
else
trace = context.trace
self:Error("Expression 2 (" .. selfTbl.name .. "): Internal error '" .. msg .. "' at line " .. trace.start_line .. ", char " .. trace.start_col, "script error")
end
end
end

Expand Down
Loading