From b7b6528395b05e50d5d4afb370663c18e25838f4 Mon Sep 17 00:00:00 2001 From: Astralcircle <142503363+Astralcircle@users.noreply.github.com> Date: Sun, 21 Jun 2026 00:22:49 +0300 Subject: [PATCH] Better wire errors stack 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 --- lua/wire/server/wirelib.lua | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/lua/wire/server/wirelib.lua b/lua/wire/server/wirelib.lua index c26b78a454..739c8939a3 100644 --- a/lua/wire/server/wirelib.lua +++ b/lua/wire/server/wirelib.lua @@ -84,14 +84,14 @@ function WireLib.TriggerInput(ent, name, value, ...) input.TriggerLimit = input.TriggerLimit - 1 end - local ok, ret = xpcall(triggerInput, debug.traceback, ent, name, value, ...) + local ok = ProtectedCall(triggerInput, ent, name, value, ...) + if not ok then local ply = WireLib.GetOwner(ent) - local validPly = IsValid(ply) - local owner_msg = validPly and (" by %s"):format(tostring(ply)) or "" - local message = ("Wire error (%s%s):\n%s\n"):format(tostring(ent), owner_msg, ret) - WireLib.ErrorNoHalt(message) - if validPly then WireLib.ClientError(message, ply) end + + if IsValid(ply) then + WireLib.ClientError("Wire error (" .. tostring(ent) .. ")", ply) + end end end