citizenfx / fivem

The source code for the Cfx.re modification frameworks, such as FiveM, RedM and LibertyM, as well as FXServer.
https://cfx.re/
3.57k stars 2.11k forks source link

Lua errors in commands (RegisterCommand) are hidden #2680

Open mcNuggets1 opened 3 months ago

mcNuggets1 commented 3 months ago

What happened?

When not in a thread, they don't output anything. It's extremely obnoxious for debugging purposes.

Creating a thread "solves" the problem, as it then outputs a proper error.

Expected result

Error

Reproduction steps

RegisterCommand("test", function() if val > 0 then return end end) shouldnt output error

Importancy

Unknown

Area(s)

FiveM, FXServer

Specific version(s)

FiveM

Additional information

No response

matthias18771 commented 3 months ago

Server/Clientside?

In case it's serverside, a while ago it was disabled by default (https://github.com/citizenfx/fivem/commit/1ddf3e4faa12269174d65f0aa20a64395ce3314c) due to some people using it spamming the server's console, it can be enabled again with this in your server.cfg:

con_removeChannelFilter forward:*/* noprint
# */

(the second line is just so txAdmin's Cfg Editor doesn't freak out)

mcNuggets1 commented 3 months ago

Yeah, but errors shouldnt be suppressed from that, only the access denied stuff.