Longer Stacktrace (cli option)

Place to ask discuss and request the modding support of Factorio. Don't request mods here.
User avatar
eradicator
Smart Inserter
Smart Inserter
Posts: 5211
Joined: Tue Jul 12, 2016 9:03 am
Contact:

Longer Stacktrace (cli option)

Post by eradicator »

What?
It would be mighty nice if the game produced a longer (full) stack trace when encountering an error during startup.

Examples
This is how a generic error during data.lua looks:
short_trace.png
short_trace.png (10.64 KiB) Viewed 1106 times
It only tells me that somewhere deep down in my library something caused an error, but i have no clue where it comes from. Ofc, i know i can insert a breakpoint and print a stacktrace from there myself:
long_trace.png
long_trace.png (17.24 KiB) Viewed 1106 times
But digging down into the lib, inserting a breakpoint, fixing the bug, removing the breakpoint... is repetitive and would in most cases be solved if the game just showed a full trace in the first place. Also not every modder (especially inexperienced ones) has a self-made stack trace printer. So this would hopefully help them greatly :). This could be dis-/enabled via a command line option if deemed nessecary, but would make it slightly less useful to new modders who might not know about it.
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.
Rseding91
Factorio Staff
Factorio Staff
Posts: 15059
Joined: Wed Jun 11, 2014 5:23 am
Contact:

Re: Longer Stacktrace (cli option)

Post by Rseding91 »

I've looked into this before and we aren't limiting the stack trace that lua generates. Simply it doesn't generate the full stack trace in all instances and I don't know why.

If you do, I can fix it :P
If you want to get ahold of me I'm almost always on Discord.
User avatar
eradicator
Smart Inserter
Smart Inserter
Posts: 5211
Joined: Tue Jul 12, 2016 9:03 am
Contact:

Re: Longer Stacktrace (cli option)

Post by eradicator »

Alas i don't though *sigh*. Random googling comes up with this stackoverflow question talking about pcall truncating stack traces and possible workarounds. But i don't even know anything about how the c-side of things does anything :roll: .
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.
Post Reply

Return to “Modding interface requests”