-
Notifications
You must be signed in to change notification settings - Fork 3
Open
Description
I have several worlds that were occasionally getting the "unable to find map for" error, but I didn't know that the error was coming from the "luscious" mod until I started looking into what might be causing some worlds to crash with the "attempt to perform arithmetic on local 'p2' (a nil value)" error (the subject of Issue #2) and saw the "unable to find map" error in the code.
Along those lines, I was thinking that maybe the following (or something similar) can be done:
-
For the "unable to find map for" error:
- Prefix the error message with the mod name so that it's clear where the message is coming from. Something like:
"(Luscious) Unable to find map for: "
- Maybe a config option to set the logging level of the message: either "error" (as it currently is), or "info" (so it only shows up in some places, depending on logging level between chat area and log file)
- Prefix the error message with the mod name so that it's clear where the message is coming from. Something like:
-
For the "attempt to perform arithmetic on local 'p2' (a nil value)" error:
- Gracefully handle the error so the world doesn't crash (I guess prevent the error by checking if
p2isnilfirst?). - Ideally, have a config setting to determine how to handle this condition (and this might apply to the "unable to find map for" error as well). Options could be:
- Throw an exception (current behavior, though intentional)
- Ignore error (default?)
- If the error is being caused by lack of biome info (maybe due to enabling this mod after biome has been created?) grab info from closest node (either within a certain (and configurable) radius, or in same biome, if at least that can be determined). This might lead to incorrect biome data being used, but it will still be close (i.e. close enough), right? If no "closest" node can be found, ignore error.
In all cases, log both the error and the action taken ("throw", "ignore", or "approximate").
- Gracefully handle the error so the world doesn't crash (I guess prevent the error by checking if
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels