Skip to content

Commit 85697a3

Browse files
authored
Better wire errors stack (#3638)
Replaces custom error messages from wire with default ones for a more understandable error stack Now errors won't be sent to the entity owner, but i don't think this will do any harm
1 parent eb9cb97 commit 85697a3

1 file changed

Lines changed: 6 additions & 6 deletions

File tree

lua/wire/server/wirelib.lua

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -84,14 +84,14 @@ function WireLib.TriggerInput(ent, name, value, ...)
8484
input.TriggerLimit = input.TriggerLimit - 1
8585
end
8686

87-
local ok, ret = xpcall(triggerInput, debug.traceback, ent, name, value, ...)
87+
local ok = ProtectedCall(triggerInput, ent, name, value, ...)
88+
8889
if not ok then
8990
local ply = WireLib.GetOwner(ent)
90-
local validPly = IsValid(ply)
91-
local owner_msg = validPly and (" by %s"):format(tostring(ply)) or ""
92-
local message = ("Wire error (%s%s):\n%s\n"):format(tostring(ent), owner_msg, ret)
93-
WireLib.ErrorNoHalt(message)
94-
if validPly then WireLib.ClientError(message, ply) end
91+
92+
if IsValid(ply) then
93+
WireLib.ClientError("Wire error (" .. tostring(ent) .. ")", ply)
94+
end
9595
end
9696
end
9797

0 commit comments

Comments
 (0)