Page 1 of 1

ServerError: error in error handling

PostPosted: Sat Jun 28, 2014 03:42
by drkwv
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.
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,
    }
)

Re: ServerError: error in error handling

PostPosted: Sat Jun 28, 2014 04:01
by drkwv
Registered an issue on the github, unsure that I made it properly though. https://github.com/minetest/minetest/issues/1423