ClojureScript

Wrap cljs.compiler/compile-file in try/catch to clarify which file failed compilation

Details

  • Type: Enhancement Enhancement
  • Status: Closed Closed
  • Priority: Major Major
  • Resolution: Completed
  • Affects Version/s: None
  • Fix Version/s: None
  • Component/s: None
  • Labels:
    None
  • Patch:
    Code

Description

lein-cljsbuild compiles files via cljs.closure/compile-dir which in turn calls compile-file. If one file fails to compile it can be rather hard to find out which file caused the error since the reference to the file is lost.

The patch ensures that the file is known and wraps the compile exception.

See example confusing trace:
https://gist.github.com/thheller/5103320#file-lein-cljsbuild-stracktrace-txt

And the more helpful version:
https://gist.github.com/thheller/5103320#file-better-trace-txt

People

Vote (0)
Watch (0)

Dates

  • Created:
    Updated:
    Resolved: