In my enchantment plugin the parsing system is a multi-step process that goes somewhat like the following:
enchantment:
single level:
single effect
A parsing issue could occur at any of these steps. My current idea is to throw an exception when an issue occurs and then catch it, add additional context, and then re-throw it in each higher parsing step until it gets to the top, where it will be shown in console.
The problem is catching and rethrowing an exception several times feels a bit janky, but I can't really think of a better idea at the moment.