phoenicis
phoenicis copied to clipboard
Enhance include System with more detailed Exceptions
Currently when an included script throws an error the shown error message doesn't tell the user where the error occurred, i.e. in which script the error occurred. We should add this information to the shown error message to ensure script developers an easier time fixing their scripts.
Can you give more detailed information on how this could be done?
In theory we only need to execute
https://github.com/PhoenicisOrg/phoenicis/blob/727481fa7ee714125539b96c12002add7e50fc4f/phoenicis-scripts/src/main/java/org/phoenicis/scripts/engine/injectors/IncludeInjector.java#L36-L43
in a try/catch
block.
When catching an exception in this block we can then wrap it in a new ScriptIncludeException
which we then again throw. This new ScriptIncludeException
should contain a scriptId
field, that contains information about the script in which the exception occurred.