Closed Joo200 closed 11 months ago
I'm a bit confused why this error would even happen in the first place. Which item data/string is causing this?
Also seeing as the error is thrown with the actual YAML known it should probably be caught here: https://github.com/ChestShop-authors/ChestShop-3/blob/6aa39cb83b5d19c49aec67dca19fb8fa257732a8/src/main/java/com/Acrobot/ChestShop/Metadata/ItemDatabase.java#L106-L108
I'm not sure how the item was created. The item deserialized is:
==: {==: ItemMeta, meta-type: UNSPECIFIC, display-name: Bottle of Wisdom}
type: EXP_BOTTLE
meta: {==: ItemMeta, meta-type: UNSPECIFIC, display-name: Bottle of Wisdom}
The raw base64 value is:
rO0ABXQApz09OiB7PT06IEl0ZW1NZXRhLCBtZXRhLXR5cGU6IFVOU1BFQ0lGSUMsIGRpc3BsYXktbmFtZTogQm90dGxlIG9mIFdpc2RvbX0KdHlwZTogRVhQX0JPVFRMRQptZXRhOiB7PT06IEl0ZW1NZXRhLCBtZXRhLXR5cGU6IFVOU1BFQ0lGSUMsIGRpc3BsYXktbmFtZTogQm90dGxlIG9mIFdpc2RvbX0K
I agree we should move this to the YAMLException instead.
Yeah that unfortunately looks like the usual YAML chanenigans :S I guess I need to look into how to disable some of the substitution/variable systems in the serializer as this seems to happen quite often...
Thanks for bringing this up and directly writing a PR for it though! Looks good now :)
A small note after the quick merge (thanks for that):
I guess I need to look into how to disable some of the substitution/variable systems in the serializer as this seems to happen quite often...
I'm pretty sure those issues are already resolved in the current releases from ChestShop. The items with those exceptions were created a few years ago (i guess 2015), newer items don't have such problems. I can send you the items.db with data since 2015 if you want to test those issues but personally I wouldn't invest much time in 8 years old stuff.
After some update of ChestShop i noticed a stacktrace from ChestShop in the server logs.
Looks like my database has a lots of corrupted items but as long as most items can be updated I'm fine with that. In my case the item is corrupted and can't be deserialized, which results in some uncatched ClassCastException.
My fix is to add this exception to the catch block.