ServerError: error in error handling
This code registers a node which upon destruction will cause "ServerError: error in error handling" error with no info about actual line and file where error had hapenned, so it could be hard to trace if you're an admin server with tons of mods installed.
Things can go even worse because in following case you might think that you have initialized the "a" variable (surprise surprise, you initialized "b")
Your phone or window isn't wide enough to display the code box. If it's a phone, try rotating it to landscape mode.
- Code: Select all
minetest.register_node(
minetest.get_current_modname()..":servererror",
{
description = "ServerError Block",
tiles = { "default_nc_rb.png" },
groups = { oddly_breakable_by_hand = 3 },
after_destruct =
function(pos, oldnode)
local a
a["b"] = "c"
end,
}
)
Things can go even worse because in following case you might think that you have initialized the "a" variable (surprise surprise, you initialized "b")
Your phone or window isn't wide enough to display the code box. If it's a phone, try rotating it to landscape mode.
- Code: Select all
minetest.register_node(
minetest.get_current_modname()..":servererror",
{
description = "ServerError Block",
tiles = { "default_nc_rb.png" },
groups = { oddly_breakable_by_hand = 3 },
after_destruct =
function(pos, oldnode)
local b,
a = {}
print(a,b) -- nil table: 0xafb07b20
a["b"] = "c"
end,
}
)