BentoBoxWorld / BentoBox

Expandable Minecraft server plugin for island-type games like SkyBlock or AcidIsland.
https://bentobox.world
Eclipse Public License 2.0
335 stars 140 forks source link

Error File Location #1787

Open BONNe opened 3 years ago

BONNe commented 3 years ago

Description

Is your feature request related to a problem?

When in some config files there are invalid material type, we are getting error like this:

[14:38:16] [Server thread/ERROR]: [BentoBox] Error in YML file: GRASS_PATH is not a valid value in the enum org.bukkit.Material!
[14:38:16] [Server thread/ERROR]: [BentoBox] Options are :
[14:38:16] [Server thread/ERROR]: [BentoBox] AIR
[14:38:16] [Server thread/ERROR]: [BentoBox] STONE
[14:38:16] [Server thread/ERROR]: [BentoBox] GRANITE

However, if you have a lot of BentoBox addons, it will take a lot of time to find which config file contains GRASS_PATH.

Describe the solution you'd like us to implement.

It would be awesome, if Error in YML file contained a path to the file which generated this exception.

tastybento commented 3 years ago

Yes, I want to fix this. Currently, the deserialize method is only aware of the class and not the file that is being used. I think I might make it throw the exception so that the error can happen higher up. Also, I'm toying with making GRASS_PATH automatically convert to DIRT_PATH, maybe with a warning.