Lua error reporting fixed!

Pazyryk

Deity
Joined
Jun 13, 2008
Messages
3,584
Beautiful, isn't it?:

Code:
 Runtime Error: C:\Users\Pazyryk\Documents\My Games\Sid Meier's Civilization 5\MODS\Ea II The Ageless and the Divine (v 14)\EaMain/EaMain.lua:237: attempt to concatenate local 'gameTurn' (a nil value)
stack traceback:
	C:\Users\Pazyryk\Documents\My Games\Sid Meier's Civilization 5\MODS\Ea II The Ageless and the Divine (v 14)\EaMain/EaMain.lua:237: in function 'EaAutoSave'
	C:\Users\Pazyryk\Documents\My Games\Sid Meier's Civilization 5\MODS\Ea II The Ageless and the Divine (v 14)\EaMain/EaMain.lua:149: in function <C:\Users\Pazyryk\Documents\My Games\Sid Meier's Civilization 5\MODS\Ea II The Ageless and the Divine (v 14)\EaMain/EaMain.lua:126>

This Lua block was called from a GameEvents call, which (before Monday) would have crashed silently with no error report to the Live Tuner.

Not only that, but look at how long those lines are! They used to be trucated at 60 characters, so you couldn't ever see the actual file or function that had the error.


I may still use xpcall to capture errors in developmental code anyway, unless someone can tell me how to generate an in-game popup from lua errors without it.
 
Well, not fixed in all cases.

A Lua block called by a RegisterCallback button from UnitPanel has an error that is not being reported. The tuner does print a blank line, which is more than it did before.
 
The long error messages is a nice fix in its self. I always thought the lack of a file name was such a senseless handicap.
 
Back
Top Bottom