Fixed
Details
Assignee
Alex MillerAlex MillerReporter
Alex MillerAlex MillerApproval
OkPatch
CodePriority
MajorAffects versions
Fix versions
Details
Details
Assignee
Alex Miller
Alex MillerReporter
Alex Miller
Alex MillerApproval
Ok
Patch
Code
Priority

Affects versions
Fix versions
Created July 22, 2019 at 7:24 PM
Updated February 2, 2022 at 9:52 PM
Resolved February 2, 2022 at 9:52 PM
Given a file that, on load, will trigger an execution error:
Loading it will report as a compile exception (syntax error), even though it's really an execution error. not a compile error (also, the location points to
(trigger)
not the place where(/ 1 0)
happens):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 wraps runtime exceptions in a CompilerException uses the constructor that sets the default exception phase of
:compilation
.Proposed: For runtime exceptions, set the exception phase to
:execution
.Patch: clj-2529-3.patch
With the patch, the error is reported as an execution error and on the correct line:
Note: related tickets here are (which introduced some of this long ago) and (whose tests are changed in this patch). The latter improved some whitespace consuming in the reader and those are good but these patches were all papering symptoms - the error triage changes in 1.10 are taking care of making better messages now.
Screened By: fogus