Skip to content

Commit

Permalink
Finish handling errors
Browse files Browse the repository at this point in the history
  • Loading branch information
Emojigit committed Jun 25, 2024
1 parent 5ae2b04 commit f19fa6e
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion mods/default/functions.lua
Original file line number Diff line number Diff line change
Expand Up @@ -312,7 +312,18 @@ function default.dig_up(pos, node, digger, max_height)
if up_node.name ~= node.name then
break
end
if not minetest.dig_node(up_pos, digger) then
local noerr, success = xpcall(function()
minetest.dig_node(up_pos, digger)
end, function(...)
in_dig_up = false
minetest.log("error", "Error raised during `default.dig_up` call:")
for line in debug.traceback(...):gmatch("([^\n]*)\n?") do
minetest.log("error", line)
end
end)
if not noerr then
error("Error raised during `default.dig_up` call")
elseif not success then
break
end
end
Expand Down

0 comments on commit f19fa6e

Please sign in to comment.