ServerError: error in error handling

drkwv
Member
 
Posts: 67
Joined: Thu Jun 28, 2012 13:48

ServerError: error in error handling

by drkwv » Sat Jun 28, 2014 03:42

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,
    }
)
 

drkwv
Member
 
Posts: 67
Joined: Thu Jun 28, 2012 13:48

Re: ServerError: error in error handling

by drkwv » Sat Jun 28, 2014 04:01

Registered an issue on the github, unsure that I made it properly though. https://github.com/minetest/minetest/issues/1423
 


Return to Minetest Problems

Who is online

Users browsing this forum: No registered users and 5 guests