Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Log error instead of crashing the game in job_coroutines.lua #44

Conversation

ketwaroo
Copy link

@ketwaroo ketwaroo commented Sep 2, 2023

fixes the root cause of many crashes that point to same line.

TL;DR

error() throws an exception basically and causes everything to crash. Logging the error, especially if it's not critical, seems the more sensible thing to do.

Long explanation:

at least 3 different errors all boil down to same line job_corutine.lua:42

fixes #20 amongst other things.

A lot of other mods and even the default game assume that actions are performed by the player only and do not expect villagers to be interacting with certain nodes and entities. It is virtually impossible to debug each and every one of them or add extra code in this mod to account for it. For example #39 adds further logic to remember failed nodes but if every node fails, we run the risk of out of memory issues as the list of failed nodes grows and grows.

While it seems tempting to throw an error to force the user to report the issue, it just makes the average user think that this mod is broken and they will more likely just uninstall it.

fixes the root cause of many crashes that point to same line.
@ketwaroo
Copy link
Author

ketwaroo commented Sep 2, 2023

Closing since 1721dea provides a better solution

@ketwaroo ketwaroo closed this Sep 2, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Error in job_thread: attempt to get length of field 'nodedata' (a nil value)
1 participant