diff options
author | sanine <sanine.not@pm.me> | 2023-02-23 00:06:07 -0600 |
---|---|---|
committer | sanine <sanine.not@pm.me> | 2023-02-23 00:06:07 -0600 |
commit | cf20cf204aa076a1c174343161427b86cbe14ce6 (patch) | |
tree | b474a341ce60d62ad9303cc34d608331db8180e1 /util | |
parent | 7f7c3cea4e0bc564009089b1520303c29164d308 (diff) |
handle errors properly when binding multiple signatures
Diffstat (limited to 'util')
-rwxr-xr-x | util/bind.lua | 13 |
1 files 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 |