Page 1 of 1

LuaRendering better error messages

Posted: Sun Nov 03, 2019 12:14 am
by eradicator
When working with LuaRendering i often get a bit frustrated at the "unfiltered" error messages, for example:

Code: Select all

bad argument #3 of 3 to 'draw_text' (number expected, got table)
Now...which one of the arguments is "#3"? By counting the parameters from top to bottom in the doc:
Table with the following fields:
text :: LocalisedString: The text to display.
surface :: SurfaceSpecification
target :: Position or LuaEntity
So..it's probably the position? But why does it say "number expected" then.

So it would be kinda nice if the messages contained some more information. (Or at least mention somewhere in the doc how argument numbers map to documented arguments (i guess it's the count of mandatory args?)).

Have a nice weekend.

Re: LuaRendering better error messages

Posted: Fri Nov 03, 2023 10:15 am
by Bilka
This was added at some point:
factorio-run_x1VYn7lD38.png
factorio-run_x1VYn7lD38.png (47.17 KiB) Viewed 270 times