Java-Runtime-Compiler icon indicating copy to clipboard operation
Java-Runtime-Compiler copied to clipboard

Report compilation errors in exception

Open Marcono1234 opened this issue 1 year ago • 0 comments

This pull request is based on #141 for simplicity; but if you want I can try to base it on the ea branch instead.

Relates to #35

Currently when you call CachedCompiler#loadFromJava with code containing compilation errors, you just get a ClassNotFoundException without any details. And depending on whether you used a custom PrinterWriter you then either have to inspect its output or System.err console output to understand the actual case. This can be rather confusing and makes troubleshooting more difficult.

This pull request here collects Error diagnostics and in case of a ClassNotFoundException includes those in the exception message.

Marcono1234 avatar Jul 21 '24 11:07 Marcono1234