From cf20cf204aa076a1c174343161427b86cbe14ce6 Mon Sep 17 00:00:00 2001 From: sanine Date: Thu, 23 Feb 2023 00:06:07 -0600 Subject: handle errors properly when binding multiple signatures --- util/bind.lua | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/util/bind.lua b/util/bind.lua index e90af9d..16ef381 100755 --- a/util/bind.lua +++ b/util/bind.lua @@ -15,8 +15,17 @@ if arg[1] == "-f" then f = io.open(arg[2] .. ".bind", "w") for _, sig in ipairs(signatures) do - f:write(b.bind(sig)) - f:write("\n\n\n") + local success, binding = pcall(b.bind, sig) + if success == false then + print( + string.format( + "bind signature \"%s\" failed: %s", sig, binding + ) + ) + else + f:write(b.bind(sig)) + f:write("\n\n\n") + end end f:close() else -- cgit v1.2.1