Log error instead of crashing the game in job_coroutines.lua #44
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.