LuaRendering better error messages

Post Reply
User avatar
eradicator
Smart Inserter
Smart Inserter
Posts: 5206
Joined: Tue Jul 12, 2016 9:03 am
Contact:

LuaRendering better error messages

Post 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.
Author of: Belt Planner, Hand Crank Generator, Screenshot Maker, /sudo and more.
Mod support languages: 日本語, Deutsch, English
My code in the post above is dedicated to the public domain under CC0.

Bilka
Factorio Staff
Factorio Staff
Posts: 3138
Joined: Sat Aug 13, 2016 9:20 am
Contact:

Re: LuaRendering better error messages

Post by Bilka »

This was added at some point:
factorio-run_x1VYn7lD38.png
factorio-run_x1VYn7lD38.png (47.17 KiB) Viewed 244 times
I'm an admin over at https://wiki.factorio.com. Feel free to contact me if there's anything wrong (or right) with it.

Post Reply

Return to “Implemented mod requests”