Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error handling in cljx-compile #70

Open
undernorthernsky opened this issue Feb 22, 2015 · 0 comments
Open

Error handling in cljx-compile #70

undernorthernsky opened this issue Feb 22, 2015 · 0 comments

Comments

@undernorthernsky
Copy link

Having this bug in project.clj:

:cljx {:builds [{ ; boring
                        :rules clj}]}

caused the rather unhelpful error:

$ lein cljx once
java.lang.NullPointerException
    at clojure.lang.Symbol.intern(Symbol.java:60)
    at clojure.core$symbol.invoke(core.clj:539)
    at cljx.core$cljx_compile.doInvoke(core.clj:85)
    at clojure.lang.RestFn.invoke(RestFn.java:410)
    at leiningen.cljx$once.invoke(cljx.clj:11)
    at leiningen.cljx$cljx.invoke(cljx.clj:33) ...

I do appreciate the freedom the fallback to resolving symbols in cljx-compile allows - but it causes a steep price for an average user (in a failure case like this).
A little more context (e.g. "NPE while trying to load namespace x") in the error message seems like a good idea.
Maybe even fuzzy checking to catch "clj" and "cljs" as strings / symbols and emit a "Did you actually mean what you wrote in the config?" message.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant