[2.0.8] make ::on_save serialization errors more verbose

Place to ask discuss and request the modding support of Factorio. Don't request mods here.
User avatar
Mithaldu
Long Handed Inserter
Long Handed Inserter
Posts: 87
Joined: Sun Mar 13, 2016 5:39 pm
Contact:

[2.0.8] make ::on_save serialization errors more verbose

Post by Mithaldu »

Right now, according to Therenas, there is not much more useful information provided by this error, so on his suggestion i'm requesting a change to the error to be a bit more verbose.

Code: Select all

Error while running event YARM::on_save()
Cannot serialise lua functions
SnelleSjonnie
Burner Inserter
Burner Inserter
Posts: 9
Joined: Mon Jan 22, 2018 8:41 pm
Contact:

Re: [2.0.8] make ::on_save serialization errors more verbose

Post by SnelleSjonnie »

Agree, please make this error a bit more developer friendly.
Rseding91
Factorio Staff
Factorio Staff
Posts: 15306
Joined: Wed Jun 11, 2014 5:23 am
Contact:

Re: [2.0.8] make ::on_save serialization errors more verbose

Post by Rseding91 »

Verbose in what way? What information are you hoping we could include in the error?
If you want to get ahold of me I'm almost always on Discord.
User avatar
boskid
Factorio Staff
Factorio Staff
Posts: 3781
Joined: Thu Dec 14, 2017 6:56 pm
Contact:

Re: [2.0.8] make ::on_save serialization errors more verbose

Post by boskid »

I do not know what exactly you want to know on top of what is already included in the error message. Since 2.0 (ref 113852) this error is thrown if you have lua functions inside of `storage`. Due to saving speed reasons, when lua values are saved we traverse the data in the most efficient way possible, by directly reading lua tables and lua values and if there is a lua function found we throw an error because this is an object that cannot be saved. If you want you can just dump the `storage` using serpent.dump and whenever you see eval() (if i remember correctly) then that was a lua function dumped and it is illegal to be there. Reason why this error is thrown is because lua functions cannot be serialised and if allowed they would have to be saved as nil instead and on load they would appear to be deleted. I do not want to include any extra path details because it is not doable in a simple way without affecting saving speed in normal case.
Bilka
Factorio Staff
Factorio Staff
Posts: 3357
Joined: Sat Aug 13, 2016 9:20 am
Contact:

Re: [2.0.8] make ::on_save serialization errors more verbose

Post by Bilka »

Would it help if the error said something like "Cannot save Lua functions in 'storage'"?
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 “Modding interface requests”