BentoBox icon indicating copy to clipboard operation
BentoBox copied to clipboard

Error File Location

Open BONNe opened this issue 3 years ago • 1 comments

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.

BONNe avatar Jun 25 '21 14:06 BONNe

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.

tastybento avatar Jun 25 '21 22:06 tastybento