Compiler.load() throws CompilerException without setting the phase, which then uses default, which is :compile-syntax-check.
Given a file that, on load, will trigger an execution error:
Loading it will report as a compile exception, even though it's not a compile error (also, the location is wrong as it points to the invoke at the end):
This case occurs particularly in Cursive, which wraps the eval'ed expression in a form that is loaded by Cursive, so all evals from within a source file have this issue.
Cause: The cause of this is in Compiler.load() - that code catches Throwable and wraps it in a CompilerException, using the original constructor which has a default phase in it.
Proposed: If the exception is a CompilerException or another exception with a phase, just pass it through. Otherwise, create a CompilerException in execution phase instead.
After, the error is execution, not compilation and it points to the line that actually caused the exception: