safe_function: only log error when there's actually an error

This commit is contained in:
Starbeamrainbowlabs 2024-10-14 20:48:55 +01:00
parent b6c41395f6
commit ea1c17a6e3
No known key found for this signature in database
GPG Key ID: 1BE5172E637709C2

@ -86,10 +86,10 @@ function safe_function(fn, args, player_name, error_msg, cmdname)
stack_trace = stack_trace,
error_msg = error_msg
})
minetest.log("error", "[//"..tostring(cmdname).."] Caught error from running function ", fn, "with args", weac.inspect(args), "for player ", player_name, "with provided error message", error_msg, ". Stack trace: ", stack_trace)
return false, stack_trace
end
minetest.log("error", "[//"..tostring(cmdname).."] Caught error from running function ", fn, "with args", weac.inspect(args), "for player ", player_name, "with provided error message", error_msg, ". Stack trace: ", stack_trace)
return true, retvals
end