<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0">
<channel>
<title>Clojure Q&amp;A - Recent questions and answers in Errors</title>
<link>https://ask.clojure.org/index.php/qa/clojure/errors</link>
<description></description>
<item>
<title>Answered: &quot;Nested&quot; vs &quot;lateral&quot; exception causes</title>
<link>https://ask.clojure.org/index.php/15031/nested-vs-lateral-exception-causes?show=15032#a15032</link>
<description>&lt;p&gt;I'm not sure this problem is common enough to warrant solving in core or extending the existing ex-info. If you are trying to throw a map bundling multiple exceptions, this really seems like a data problem more than an exception problem, and we have plenty of ways to bundle data into the ex map.&lt;/p&gt;
&lt;p&gt;In Java, the typical solution for (one) lateral exception is to use &lt;a rel=&quot;nofollow&quot; href=&quot;https://docs.oracle.com/javase/8/docs/api/java/util/concurrent/ExecutionException.html&quot;&gt;ExecutionException&lt;/a&gt;, doesn't handle multiple though.&lt;/p&gt;
</description>
<category>Errors</category>
<guid isPermaLink="true">https://ask.clojure.org/index.php/15031/nested-vs-lateral-exception-causes?show=15032#a15032</guid>
<pubDate>Sun, 05 Apr 2026 21:46:32 +0000</pubDate>
</item>
<item>
<title>`(even? (range))` hangs</title>
<link>https://ask.clojure.org/index.php/14578/even-range-hangs</link>
<description>&lt;p&gt;It is, of course, an error to call &lt;code&gt;(even? (range))&lt;/code&gt;, but still - I'd much rather prefer a class cast exception. Or the existing &lt;code&gt;IllegalArgumentException&lt;/code&gt;, just without printing the argument. Especially given that the argument could be absolutely anything, including side-effecting lazy collections.&lt;/p&gt;
&lt;p&gt;A couple of other cases like this:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;(array-map (range))
(requiring-resolve (range))
&lt;/code&gt;&lt;/pre&gt;
</description>
<category>Errors</category>
<guid isPermaLink="true">https://ask.clojure.org/index.php/14578/even-range-hangs</guid>
<pubDate>Sun, 08 Jun 2025 11:54:29 +0000</pubDate>
</item>
<item>
<title>Answered: How can tools better detect errors coming from non-existing methods/fields?</title>
<link>https://ask.clojure.org/index.php/13339/tools-better-detect-errors-coming-existing-methods-fields?show=13713#a13713</link>
<description>&lt;p&gt;This has been provided with the new Uniform qualified method syntax in &lt;a rel=&quot;nofollow&quot; href=&quot;https://clojure.org/news/2024/02/08/1-12-alpha6&quot;&gt;Clojure 1.12.0-alpha6&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;Instead of using &lt;code&gt;(.a &quot;&quot;)&lt;/code&gt;, use the Class/member syntax. In this case, &lt;code&gt;(String/.a &quot;&quot;)&lt;/code&gt;. This will either compile (indicating that the Clojure compiler found a single method that matches the provided inputs), or it will throw a syntax exception (indicating that it found either 0 matching methods or multiple matching methods).&lt;/p&gt;
&lt;p&gt;By only using this syntax, you can be sure that you're always matching against specific methods with no reflection.&lt;/p&gt;
</description>
<category>Errors</category>
<guid isPermaLink="true">https://ask.clojure.org/index.php/13339/tools-better-detect-errors-coming-existing-methods-fields?show=13713#a13713</guid>
<pubDate>Tue, 13 Feb 2024 19:08:39 +0000</pubDate>
</item>
<item>
<title>Answered: Should 'method value' error messages (wrong arity) special case for constructors?</title>
<link>https://ask.clojure.org/index.php/13707/should-method-value-error-messages-wrong-special-constructors?show=13708#a13708</link>
<description>&lt;p&gt;Yes, seems like that is missing the constructor specific wording, will take a look, thanks.&lt;/p&gt;
</description>
<category>Errors</category>
<guid isPermaLink="true">https://ask.clojure.org/index.php/13707/should-method-value-error-messages-wrong-special-constructors?show=13708#a13708</guid>
<pubDate>Tue, 13 Feb 2024 01:50:21 +0000</pubDate>
</item>
<item>
<title>Answered: Wrong line number reported for exceptions thrown by code generated by destructuring</title>
<link>https://ask.clojure.org/index.php/13605/number-reported-exceptions-thrown-generated-destructuring?show=13606#a13606</link>
<description>&lt;p&gt;Logged as &lt;a rel=&quot;nofollow&quot; href=&quot;https://clojure.atlassian.net/browse/CLJ-2824&quot;&gt;https://clojure.atlassian.net/browse/CLJ-2824&lt;/a&gt;&lt;/p&gt;
</description>
<category>Errors</category>
<guid isPermaLink="true">https://ask.clojure.org/index.php/13605/number-reported-exceptions-thrown-generated-destructuring?show=13606#a13606</guid>
<pubDate>Sat, 06 Jan 2024 18:48:09 +0000</pubDate>
</item>
<item>
<title>Answered: `ClassCastException` when misplacing `nth` args</title>
<link>https://ask.clojure.org/index.php/13539/classcastexception-when-misplacing-nth-args?show=13578#a13578</link>
<description>&lt;p&gt;Jira ticket &lt;a rel=&quot;nofollow&quot; href=&quot;https://clojure.atlassian.net/browse/CLJ-2822&quot;&gt;CLJ-2822&lt;/a&gt; was created to track this issue.&lt;/p&gt;
</description>
<category>Errors</category>
<guid isPermaLink="true">https://ask.clojure.org/index.php/13539/classcastexception-when-misplacing-nth-args?show=13578#a13578</guid>
<pubDate>Tue, 19 Dec 2023 21:21:04 +0000</pubDate>
</item>
<item>
<title>Answered: Null pointer error when using filter</title>
<link>https://ask.clojure.org/index.php/13302/null-pointer-error-when-using-filter?show=13304#a13304</link>
<description>&lt;p&gt;The title is misleading - there's no NPE here, only class cast exception.&lt;/p&gt;
&lt;p&gt;There &lt;em&gt;is&lt;/em&gt; a stack trace (notice how I used &lt;code&gt;*e&lt;/code&gt; in my REPL to print the latest exception):&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;Clojure 1.11.1
user=&amp;gt; (filter zero? [:hi])
Error printing return value (ClassCastException) at clojure.lang.Numbers/isZero (Numbers.java:119).
class clojure.lang.Keyword cannot be cast to class java.lang.Number (clojure.lang.Keyword is in unnamed module of loader 'app'; java.lang.Number is in module java.base of loader 'bootstrap')
(user=&amp;gt; 
user=&amp;gt; *e
#error {
 :cause &quot;class clojure.lang.Keyword cannot be cast to class java.lang.Number (clojure.lang.Keyword is in unnamed module of loader 'app'; java.lang.Number is in module java.base of loader 'bootstrap')&quot;
 :via
 [{:type clojure.lang.ExceptionInfo
   :message nil
   :data #:clojure.error{:phase :print-eval-result}
   :at [clojure.main$repl$read_eval_print__9206 invoke &quot;main.clj&quot; 442]}
  {:type java.lang.ClassCastException
   :message &quot;class clojure.lang.Keyword cannot be cast to class java.lang.Number (clojure.lang.Keyword is in unnamed module of loader 'app'; java.lang.Number is in module java.base of loader 'bootstrap')&quot;
   :at [clojure.lang.Numbers isZero &quot;Numbers.java&quot; 119]}]
 :trace
 [[clojure.lang.Numbers isZero &quot;Numbers.java&quot; 119]
  [clojure.core$zero_QMARK_ invokeStatic &quot;core.clj&quot; 874]
  [clojure.core$zero_QMARK_ invoke &quot;core.clj&quot; 869]
  [clojure.core$filter$fn__5962 invoke &quot;core.clj&quot; 2834]
  [clojure.lang.LazySeq sval &quot;LazySeq.java&quot; 42]
  [clojure.lang.LazySeq seq &quot;LazySeq.java&quot; 51]
  [clojure.lang.RT seq &quot;RT.java&quot; 535]
  [clojure.core$seq__5467 invokeStatic &quot;core.clj&quot; 139]
  [clojure.core$print_sequential invokeStatic &quot;core_print.clj&quot; 53]
[...]
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;So it seems that either the tools that you're using with Clojure hide it from you for some reason (in which case knowing the exact steps you perform to &lt;em&gt;not&lt;/em&gt; get a stacktrace would be helpful) or you didn't look in the right place.&lt;/p&gt;
&lt;p&gt;And in case you mean that the stacktrace seems to be pointing away from where you call &lt;code&gt;filter&lt;/code&gt; - that's because &lt;code&gt;filter&lt;/code&gt; doesn't actually filter anything, it creates a lazy seq that filters things out when it's being iterated over. So the stacktrace will might not include where &lt;code&gt;filter&lt;/code&gt; is called but will include where the resulting lazy seq is being realized.&lt;/p&gt;
</description>
<category>Errors</category>
<guid isPermaLink="true">https://ask.clojure.org/index.php/13302/null-pointer-error-when-using-filter?show=13304#a13304</guid>
<pubDate>Sat, 16 Sep 2023 07:29:19 +0000</pubDate>
</item>
<item>
<title>Poor Errors when deref'ing a non-IDeref/non-Future</title>
<link>https://ask.clojure.org/index.php/13056/poor-errors-when-derefing-a-non-ideref-non-future</link>
<description>&lt;h2&gt;Problem Statement&lt;/h2&gt;
&lt;p&gt;The function &lt;code&gt;clojure.core/deref&lt;/code&gt; throws a hard-to-decipher &lt;code&gt;ClassCastException&lt;/code&gt; when given an object that's not an instance of &lt;code&gt;clojure.lang.IDeref&lt;/code&gt; or &lt;code&gt;java.util.concurrent.Future&lt;/code&gt;. In my experience on-boarding new Clojure users (at my job and in my open source projects), this comes up and can be quite confusing as it doesn't point to anything obvious in the code. Even with the stack trace, it just points to &lt;code&gt;deref-future&lt;/code&gt;'s definition (instead of a specific line within the function body), which further confuses.&lt;/p&gt;
&lt;h2&gt;Discussion&lt;/h2&gt;
&lt;p&gt;On Slack, I proposed changing the implementation of &lt;code&gt;deref&lt;/code&gt; to be something like &lt;code&gt;(cond (instance? clojure.lang.IDeref ref) ... (instance? java.util.concurrent.Future ref) ... :else (throw (IllegalArgumentException (str ref &quot; cannot be deref'd as it is of type &quot; (class ref) &quot;.&quot;))&lt;/code&gt;.&lt;/p&gt;
&lt;p&gt;Sean Corfield brought up that such a fix would cost performance for all non-IDeref uses of &lt;code&gt;deref&lt;/code&gt;, which I acknowledged but find acceptable.&lt;/p&gt;
&lt;h2&gt;Repro:&lt;/h2&gt;
&lt;pre&gt;&lt;code&gt;user=&amp;gt; (def a {})
#'user/a

user=&amp;gt; @a
Execution error (ClassCastException) at user/eval22861 (REPL:0).
class clojure.lang.PersistentArrayMap cannot be cast to class java.util.concurrent.Future (clojure.lang.PersistentArrayMap is in unnamed module of loader 'app'; java.util.concurrent.Future is in module java.base of loader 'bootstrap')

user=&amp;gt; (pst)
ClassCastException class clojure.lang.PersistentArrayMap cannot be cast to class java.util.concurrent.Future (clojure.lang.PersistentArrayMap is in unnamed module of loader 'app'; java.util.concurrent.Future is in module java.base of loader 'bootstrap')
    clojure.core/deref-future (core.clj:2315)
    clojure.core/deref-future (core.clj:2315)
    clojure.core/deref (core.clj:2338)
    clojure.core/deref (core.clj:2323)
    user/eval22863 (NO_SOURCE_FILE:0)
    user/eval22863 (NO_SOURCE_FILE:-1)
    clojure.lang.Compiler.eval (Compiler.java:7194)
    clojure.lang.Compiler.eval (Compiler.java:7149)
    clojure.core/eval (core.clj:3215)
    clojure.core/eval (core.clj:3211)
    clojure.main/repl/read-eval-print--9206/fn--9209 (main.clj:437)
    clojure.main/repl/read-eval-print--9206 (main.clj:437)
&lt;/code&gt;&lt;/pre&gt;
</description>
<category>Errors</category>
<guid isPermaLink="true">https://ask.clojure.org/index.php/13056/poor-errors-when-derefing-a-non-ideref-non-future</guid>
<pubDate>Mon, 03 Jul 2023 18:08:19 +0000</pubDate>
</item>
<item>
<title>Answered: Interest in beginner-friendly variant of (pst)?</title>
<link>https://ask.clojure.org/index.php/13044/interest-in-beginner-friendly-variant-of-pst?show=13045#a13045</link>
<description>&lt;p&gt;There are at least two, maybe more, different problems / ideas here and it would be helpful to separate them. The ex-str / hook idea seems orthogonal.&lt;/p&gt;
&lt;p&gt;Serious question - if the error messages are ok (you said it was here), and the tooling never shows the stack trace, why is this a beginner issue? Error messages try to show a good location for the source error (to the degree that they can given macros).&lt;/p&gt;
&lt;p&gt;&quot;Beginner-friendly&quot; is, I think, not the right framing as it does not say anything about the problem. Seems like if a stack trace could be more illuminating, then it would be useful to both beginners and non-beginners, and we would be helped by concretely listing challenges in understanding stack traces. Off the top of my head...&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;Clojure function invocation often involves 2 or 3 frames per invocation&lt;/li&gt;
&lt;li&gt;Anonymous functions have obscure names&lt;/li&gt;
&lt;li&gt;Anonymous functions are implicitly created in some cases by the implementation&lt;/li&gt;
&lt;li&gt;User calls macros, but stack traces deal in the expanded code (the code you write != the code you run) - this is a fundamental problem for both error messages and stack traces&lt;/li&gt;
&lt;li&gt;Macro code often creates gensym names that become class names&lt;/li&gt;
&lt;li&gt;REPL infrastructure is in the stack&lt;/li&gt;
&lt;li&gt;Tooling infrastructure is in the stack (printers, nrepl, middleware)&lt;/li&gt;
&lt;li&gt;Mixture of Clojure core lib and Clojure Java impl&lt;/li&gt;
&lt;li&gt;Stack traces redundantly show file name in addition to Clojure ns or Java class&lt;/li&gt;
&lt;li&gt;Line numbers don't correlate to source correctly&lt;/li&gt;
&lt;li&gt;Laziness  effects&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;A &quot;simplified stack trace&quot; function would need to be clear about which of these or other potential problems were actually important. Some of these are pretty straightforward, some are quite hard.&lt;/p&gt;
&lt;p&gt;Keep in mind that showing an alternate view of reality will always be in tension with the risk of hiding the actual information that illuminates why you're looking at a stack trace in the first place.&lt;/p&gt;
&lt;p&gt;If a simplified stack printer function is useful, then this can be done independent of core. Dev tooling in particular is in a great position to augment here.&lt;/p&gt;
</description>
<category>Errors</category>
<guid isPermaLink="true">https://ask.clojure.org/index.php/13044/interest-in-beginner-friendly-variant-of-pst?show=13045#a13045</guid>
<pubDate>Sat, 01 Jul 2023 20:09:06 +0000</pubDate>
</item>
<item>
<title>Answered: Vector comparisons raise &quot;clojure.lang.PersistentVector cannot be cast to java.lang.Number&quot; exception</title>
<link>https://ask.clojure.org/index.php/12479/vector-comparisons-clojure-persistentvector-cannot-exception?show=12480#a12480</link>
<description>&lt;p&gt;Comparing vectors will compare the elements in each index. For the example you have, the second elements are a number and a vector. The default comparator (which is the &lt;code&gt;compare&lt;/code&gt; function) is not a universal comparator - there is no defined comparison between a number and a vector. So you will get a ClassCastException trying to compare them.&lt;/p&gt;
&lt;p&gt;You can use functions like &lt;code&gt;sort&lt;/code&gt; or &lt;code&gt;sort-by&lt;/code&gt; that also take a custom comparator. More on comparators here: &lt;a rel=&quot;nofollow&quot; href=&quot;https://clojure.org/guides/comparators&quot;&gt;https://clojure.org/guides/comparators&lt;/a&gt;&lt;/p&gt;
</description>
<category>Errors</category>
<guid isPermaLink="true">https://ask.clojure.org/index.php/12479/vector-comparisons-clojure-persistentvector-cannot-exception?show=12480#a12480</guid>
<pubDate>Wed, 14 Dec 2022 22:42:13 +0000</pubDate>
</item>
<item>
<title>Answered: Error : ClassCastException</title>
<link>https://ask.clojure.org/index.php/12467/error-classcastexception?show=12472#a12472</link>
<description>&lt;p&gt;you are calling products_2 as a function, and it is a seq of maps, not a function, which is what the class cast exception there means.&lt;/p&gt;
&lt;p&gt;a map can be invoked as a function, but a seq of maps cannot&lt;/p&gt;
</description>
<category>Errors</category>
<guid isPermaLink="true">https://ask.clojure.org/index.php/12467/error-classcastexception?show=12472#a12472</guid>
<pubDate>Mon, 12 Dec 2022 21:22:14 +0000</pubDate>
</item>
<item>
<title>Answered: #object[db$getnameonly 0x66908383 db$getnameonly@66908383] 1</title>
<link>https://ask.clojure.org/index.php/12449/object-dbgetnameonly-0x66908383-dbgetnameonly66908383?show=12454#a12454</link>
<description>&lt;p&gt;Interestingly, what you've got there is not a error it at, it's an &lt;code&gt;object&lt;/code&gt; (!) like it says. (:&lt;/p&gt;
&lt;p&gt;I might write it like this, given the shape you've provided:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;user&amp;gt; (def customers '([1 (&quot;John Smith&quot; &quot;123 Here Street&quot; &quot;456-4567&quot;)]
                       [2 (&quot;Sue Jones&quot; &quot;43 Rose Court Street&quot; &quot;345-7867&quot;)]
                       [3 (&quot;Fan Yuhong&quot; &quot;165 Happy Lane&quot;&quot;345-4533&quot;)]))
#'user/customers
user&amp;gt; customers
([1 (&quot;John Smith&quot; &quot;123 Here Street&quot; &quot;456-4567&quot;)]
 [2 (&quot;Sue Jones&quot; &quot;43 Rose Court Street&quot; &quot;345-7867&quot;)]
 [3 (&quot;Fan Yuhong&quot; &quot;165 Happy Lane&quot; &quot;345-4533&quot;)])
user&amp;gt; (defn id-&amp;gt;name
        [customers id]
        (-&amp;gt;&amp;gt; (filter #(= id (first %)) customers)
             (first)
             (second)
             (first)))
#'user/id-&amp;gt;name
user&amp;gt; (id-&amp;gt;name customers 3)
&quot;Fan Yuhong&quot;
user&amp;gt; (id-&amp;gt;name customers 2)
&quot;Sue Jones&quot;
user&amp;gt; (id-&amp;gt;name customers 1)
&quot;John Smith&quot;
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Best of luck with your assignment! &lt;/p&gt;
</description>
<category>Errors</category>
<guid isPermaLink="true">https://ask.clojure.org/index.php/12449/object-dbgetnameonly-0x66908383-dbgetnameonly66908383?show=12454#a12454</guid>
<pubDate>Fri, 09 Dec 2022 17:30:09 +0000</pubDate>
</item>
<item>
<title>Answered: problem with intersection</title>
<link>https://ask.clojure.org/index.php/12428/problem-with-intersection?show=12429#a12429</link>
<description>&lt;p&gt;The problem is that &lt;code&gt;clojure.set/intersection&lt;/code&gt; is defined as:&lt;/p&gt;
&lt;blockquote&gt;&lt;p&gt;Return a set that is the intersection of the input sets&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;That is, it assumes that all of the arguments that you pass in are sets. Which is not your case. You are passing in &lt;strong&gt;vectors&lt;/strong&gt;. Given that the input arguments do not respect the pre-conditions of the function contract, all bets are off with respect to its behaviour.&lt;/p&gt;
&lt;p&gt;In fact, your first version also throws the same exception if the second vector doesn't contain any value that is also present in the first one:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;user=&amp;gt; (apply set/intersection [[1 2 3] [4]])
Execution error (ClassCastException) at user/eval2082 (REPL:1). class clojure.lang.PersistentVector cannot be cast to class clojure.lang.IPersistentSet
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;As you can see, it only &quot;works&quot; in a very limited sub-set of scenarios (and by pure chance) when not using sets for the arguments. On the other hand, using sets works as expected:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;user=&amp;gt; (apply set/intersection [#{1 2 3} #{4}])
#{}
user=&amp;gt; (apply set/intersection [#{1 2 3} #{1}])
#{1}
user=&amp;gt; (apply set/intersection [#{\f \o} #{\o}])
#{\o}
user=&amp;gt; (apply set/intersection [#{\f \o} #{\a}])
#{}
&lt;/code&gt;&lt;/pre&gt;
</description>
<category>Errors</category>
<guid isPermaLink="true">https://ask.clojure.org/index.php/12428/problem-with-intersection?show=12429#a12429</guid>
<pubDate>Sun, 04 Dec 2022 15:34:22 +0000</pubDate>
</item>
<item>
<title>Answered: clojure.stacktrace/print-throwable fails if ex-data is unprintable</title>
<link>https://ask.clojure.org/index.php/12369/clojure-stacktrace-print-throwable-fails-data-unprintable?show=12370#a12370</link>
<description>&lt;p&gt;Logged as &lt;a rel=&quot;nofollow&quot; href=&quot;https://clojure.atlassian.net/browse/CLJ-2736&quot;&gt;https://clojure.atlassian.net/browse/CLJ-2736&lt;/a&gt;&lt;/p&gt;
</description>
<category>Errors</category>
<guid isPermaLink="true">https://ask.clojure.org/index.php/12369/clojure-stacktrace-print-throwable-fails-data-unprintable?show=12370#a12370</guid>
<pubDate>Wed, 09 Nov 2022 00:07:14 +0000</pubDate>
</item>
<item>
<title>Answered: Why i get &quot;No suitable driver found for jdbc:://127.0.0.1/&quot; ?</title>
<link>https://ask.clojure.org/index.php/12247/why-i-get-no-suitable-driver-found-for-jdbc-127-0-0-1?show=12248#a12248</link>
<description>&lt;p&gt;You're using the old &lt;code&gt;clojure.java.jdbc&lt;/code&gt; format of db-spec hash map instead of the (simpler) &lt;code&gt;next.jdbc&lt;/code&gt; format.&lt;/p&gt;
&lt;p&gt;You want to remove &lt;code&gt;:classname&lt;/code&gt;, &lt;code&gt;:subprotocol&lt;/code&gt;, and &lt;code&gt;:subname&lt;/code&gt; and use &lt;code&gt;:dbtype &quot;postgresql&quot; :dbname &quot;reporting&quot;&lt;/code&gt; instead.&lt;/p&gt;
&lt;p&gt;That simpler format works with &lt;code&gt;clojure.java.jdbc&lt;/code&gt; too -- and is the recommended approach there too. The format you are using is really a legacy format that hasn't been recommended for a while.&lt;/p&gt;
</description>
<category>Errors</category>
<guid isPermaLink="true">https://ask.clojure.org/index.php/12247/why-i-get-no-suitable-driver-found-for-jdbc-127-0-0-1?show=12248#a12248</guid>
<pubDate>Mon, 26 Sep 2022 22:05:12 +0000</pubDate>
</item>
<item>
<title>Answered: Whenever I start a project, an error occurs :main namespace specified in project.clj?</title>
<link>https://ask.clojure.org/index.php/11977/whenever-start-project-occurs-namespace-specified-project?show=11979#a11979</link>
<description>&lt;p&gt;You need to tell lein &lt;em&gt;which&lt;/em&gt; namespace has the  -main function that you want to run: probably &lt;code&gt;clojure-noob.core&lt;/code&gt;. You might think your program has only 1 namespace, but in fact it will have several, including for example clojure.core, clojure.repl, clojure.main, etc., in addition to whatever your project contains.  &lt;/p&gt;
&lt;p&gt;The command &lt;code&gt;lein help run&lt;/code&gt; will give instructions on how to specify the ns to run.&lt;/p&gt;
</description>
<category>Errors</category>
<guid isPermaLink="true">https://ask.clojure.org/index.php/11977/whenever-start-project-occurs-namespace-specified-project?show=11979#a11979</guid>
<pubDate>Fri, 17 Jun 2022 16:43:55 +0000</pubDate>
</item>
<item>
<title>Answered: Can the &quot;Key must be integer&quot; error message be improved?</title>
<link>https://ask.clojure.org/index.php/11907/can-the-key-must-be-integer-error-message-be-improved?show=11908#a11908</link>
<description>&lt;p&gt;Logged as &lt;a rel=&quot;nofollow&quot; href=&quot;https://clojure.atlassian.net/browse/CLJ-2710&quot;&gt;https://clojure.atlassian.net/browse/CLJ-2710&lt;/a&gt;&lt;/p&gt;
</description>
<category>Errors</category>
<guid isPermaLink="true">https://ask.clojure.org/index.php/11907/can-the-key-must-be-integer-error-message-be-improved?show=11908#a11908</guid>
<pubDate>Wed, 25 May 2022 12:25:42 +0000</pubDate>
</item>
<item>
<title>Answered: clojure.data/diff or clojure.set/difference return unexpected results</title>
<link>https://ask.clojure.org/index.php/11889/clojure-data-clojure-difference-return-unexpected-results?show=11891#a11891</link>
<description>&lt;p&gt;Solved, my problem was that I get data from datomic so I need to coerce into schema and after do the diff with this resultant set&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;(-&amp;gt;&amp;gt; all-results
         map #(schema/coerce! % models.schema/Result))
         set)
&lt;/code&gt;&lt;/pre&gt;
</description>
<category>Errors</category>
<guid isPermaLink="true">https://ask.clojure.org/index.php/11889/clojure-data-clojure-difference-return-unexpected-results?show=11891#a11891</guid>
<pubDate>Thu, 12 May 2022 19:10:14 +0000</pubDate>
</item>
<item>
<title>Answered: command works on Linux but fails on Windows</title>
<link>https://ask.clojure.org/index.php/11424/command-works-on-linux-but-fails-on-windows?show=11425#a11425</link>
<description>&lt;p&gt;Windows cmd.exe and Powershell both require different quoting to Linux/macOS.&lt;/p&gt;
&lt;p&gt;Try either double or triple &quot; around the version instead of single &quot;&lt;/p&gt;
&lt;p&gt;(according to the 2020 &quot;State of Clojure&quot; survey, only about 5% of Clojure users are on Windows with cmd or PS, 5% use Windows with WSL2 and therefore run Clojure stuff on Linux, and 90% use macOS or Linux -- which is why you'll often find instructions/tutorials that do not work as-is on Windows cmd/PS)&lt;/p&gt;
</description>
<category>Errors</category>
<guid isPermaLink="true">https://ask.clojure.org/index.php/11424/command-works-on-linux-but-fails-on-windows?show=11425#a11425</guid>
<pubDate>Tue, 28 Dec 2021 19:25:09 +0000</pubDate>
</item>
<item>
<title>Answered: Exception in thread &quot;main&quot; java.lang.RuntimeException: Unable to find static field:</title>
<link>https://ask.clojure.org/index.php/11333/exception-thread-main-runtimeexception-unable-static-field?show=11334#a11334</link>
<description>&lt;p&gt;Well, I don't know anything about this project, but it's saying that in edu/upc/nlp4bpm_commons/Freeling.clj (which is under nlp4bpm_commons/src/main/clojure/ in the repo), that Clojure code refers to a static field AnalysisLevel/IDENT in class edu.upc.Jfreeling.AnalysisLevel and finding that that field doesn't exist. &lt;/p&gt;
&lt;p&gt;AnalysisLevel is a class in the Java jar local-jars/Jfreeling.jar. which does have that class with that field, so if I had to guess, maybe there was a missed step in that (pretty weird) install procedure?&lt;/p&gt;
</description>
<category>Errors</category>
<guid isPermaLink="true">https://ask.clojure.org/index.php/11333/exception-thread-main-runtimeexception-unable-static-field?show=11334#a11334</guid>
<pubDate>Tue, 30 Nov 2021 14:11:05 +0000</pubDate>
</item>
<item>
<title>Answered: Some CompilerExceptions lack the file path, only having the file name</title>
<link>https://ask.clojure.org/index.php/11248/some-compilerexceptions-lack-file-path-only-having-file-name?show=11329#a11329</link>
<description>&lt;p&gt;Generally, execution exceptions can occur anywhere (not just in Clojure code) and we rely more on the stack trace to identify locations for those with &lt;code&gt;(pst *e)&lt;/code&gt;. For things like compilation/macroexpansion checks those are definitely in Clojure code so they're handled differently.&lt;/p&gt;
</description>
<category>Errors</category>
<guid isPermaLink="true">https://ask.clojure.org/index.php/11248/some-compilerexceptions-lack-file-path-only-having-file-name?show=11329#a11329</guid>
<pubDate>Mon, 29 Nov 2021 16:58:38 +0000</pubDate>
</item>
<item>
<title>Answered: make use of deprecated namespaces/vars easier to spot</title>
<link>https://ask.clojure.org/index.php/4625/make-use-of-deprecated-namespaces-vars-easier-to-spot?show=11185#a11185</link>
<description>&lt;p&gt;Would be great to see this in the next clojure version.&lt;/p&gt;
</description>
<category>Errors</category>
<guid isPermaLink="true">https://ask.clojure.org/index.php/4625/make-use-of-deprecated-namespaces-vars-easier-to-spot?show=11185#a11185</guid>
<pubDate>Mon, 25 Oct 2021 13:24:01 +0000</pubDate>
</item>
<item>
<title>Answered: Improve error messages from `reify` forms</title>
<link>https://ask.clojure.org/index.php/11142/improve-error-messages-from-reify-forms?show=11143#a11143</link>
<description>&lt;p&gt;Logged as &lt;a rel=&quot;nofollow&quot; href=&quot;https://clojure.atlassian.net/browse/CLJ-2661&quot;&gt;https://clojure.atlassian.net/browse/CLJ-2661&lt;/a&gt;&lt;/p&gt;
</description>
<category>Errors</category>
<guid isPermaLink="true">https://ask.clojure.org/index.php/11142/improve-error-messages-from-reify-forms?show=11143#a11143</guid>
<pubDate>Thu, 07 Oct 2021 15:53:35 +0000</pubDate>
</item>
<item>
<title>Answered: Literal set with duplicate values reports error with wrong line number</title>
<link>https://ask.clojure.org/index.php/10513/literal-with-duplicate-values-reports-error-with-wrong-number?show=10514#a10514</link>
<description>&lt;p&gt;Logged as &lt;a rel=&quot;nofollow&quot; href=&quot;https://clojure.atlassian.net/browse/CLJ-2624&quot;&gt;https://clojure.atlassian.net/browse/CLJ-2624&lt;/a&gt;&lt;/p&gt;
</description>
<category>Errors</category>
<guid isPermaLink="true">https://ask.clojure.org/index.php/10513/literal-with-duplicate-values-reports-error-with-wrong-number?show=10514#a10514</guid>
<pubDate>Thu, 22 Apr 2021 18:06:53 +0000</pubDate>
</item>
<item>
<title>Answered: Stacktraces with clojure functions contain irrelevant information</title>
<link>https://ask.clojure.org/index.php/10470/stacktraces-clojure-functions-contain-irrelevant-information?show=10480#a10480</link>
<description>&lt;p&gt;Per Kevin's comment, I do really want to see the actual stack trace so I don't think that should go away. But it's also useful to think about tools that can be applied to stack traces to give you better insight. That said, a lot of people have poured time into this and the results are not (imo) better than the original. I say that not to throw water on it, but just to note that it seems easy but the details are complicated.&lt;/p&gt;
&lt;p&gt;I should mention that you happen to have chosen a scenario that is tickling a known bug in load &lt;a rel=&quot;nofollow&quot; href=&quot;https://clojure.atlassian.net/browse/CLJ-2529&quot;&gt;https://clojure.atlassian.net/browse/CLJ-2529&lt;/a&gt; where the phase is being incorrectly reported (here reached from a top-level form eval). While this is obviously possible, you would more typically have gotten this by having no top-level call of bar and putting this code in a namespace:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;(ns repro)

(defn foo []
  (/ 1 0))

(defn bar []
  (foo))
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;and then put repro in your sources and called:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;% clj
Clojure 1.10.3
user=&amp;gt; (require 'repro)
nil
user=&amp;gt; (repro/bar)
Execution error (ArithmeticException) at repro/foo (repro.clj:4).
Divide by zero
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;I think you should also note that Clojure provides a function to print stack traces (pst) that does some level of clean up for you (in some cases it will even elide top-level frames involved in the error reporting as well - that was tweaked in 1.10.0 to improve a number of cases):&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;user=&amp;gt; (pst *e)
ArithmeticException Divide by zero
	clojure.lang.Numbers.divide (Numbers.java:188)
	clojure.lang.Numbers.divide (Numbers.java:3901)
	repro/foo (repro.clj:4)
	repro/foo (repro.clj:3)
	repro/bar (repro.clj:7)
	repro/bar (repro.clj:6)
	user/eval150 (NO_SOURCE_FILE:1)
	user/eval150 (NO_SOURCE_FILE:1)
	clojure.lang.Compiler.eval (Compiler.java:7181)
	clojure.lang.Compiler.eval (Compiler.java:7136)
	clojure.core/eval (core.clj:3202)
	clojure.core/eval (core.clj:3198)
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Since this is a &quot;printing&quot; method, it might be a place where we could do more to help, like merging invoke frames. Detecting that these are the same frame might be challenging, I don't know. The tools for emitting line/col debug symbols in bytecode are weird and I don't think that stuff has been touched in forever, there may even be options we could use that didn't exist originally. (Look for visitSource and visitLineNumber in the Compiler and the source debug extension stuff like &lt;a rel=&quot;nofollow&quot; href=&quot;https://github.com/clojure/clojure/blob/master/src/jvm/clojure/lang/Compiler.java#L4326-L4340&quot;&gt;https://github.com/clojure/clojure/blob/master/src/jvm/clojure/lang/Compiler.java#L4326-L4340&lt;/a&gt; - see JSR 45 for that).&lt;/p&gt;
&lt;p&gt;I believe JRuby has spent a lot of time on this same problem (showing you a ruby stack trace that came from a jruby jvm stack trace), that might be an interesting thing to learn more about (I have not studied it).&lt;/p&gt;
</description>
<category>Errors</category>
<guid isPermaLink="true">https://ask.clojure.org/index.php/10470/stacktraces-clojure-functions-contain-irrelevant-information?show=10480#a10480</guid>
<pubDate>Thu, 15 Apr 2021 05:09:12 +0000</pubDate>
</item>
<item>
<title>Answered: Support for suppressed exceptions</title>
<link>https://ask.clojure.org/index.php/10384/support-for-suppressed-exceptions?show=10388#a10388</link>
<description>&lt;p&gt;Logged as &lt;a rel=&quot;nofollow&quot; href=&quot;https://clojure.atlassian.net/browse/CLJ-2618&quot;&gt;https://clojure.atlassian.net/browse/CLJ-2618&lt;/a&gt;&lt;/p&gt;
</description>
<category>Errors</category>
<guid isPermaLink="true">https://ask.clojure.org/index.php/10384/support-for-suppressed-exceptions?show=10388#a10388</guid>
<pubDate>Tue, 30 Mar 2021 17:09:32 +0000</pubDate>
</item>
<item>
<title>Answered: signal an error on mulimethod without a dispatch function?</title>
<link>https://ask.clojure.org/index.php/9737/signal-an-error-on-mulimethod-without-a-dispatch-function?show=9744#a9744</link>
<description>&lt;p&gt;Covered by existing spec enhancement &lt;a rel=&quot;nofollow&quot; href=&quot;https://clojure.atlassian.net/browse/CLJ-2416&quot;&gt;https://clojure.atlassian.net/browse/CLJ-2416&lt;/a&gt;&lt;/p&gt;
</description>
<category>Errors</category>
<guid isPermaLink="true">https://ask.clojure.org/index.php/9737/signal-an-error-on-mulimethod-without-a-dispatch-function?show=9744#a9744</guid>
<pubDate>Fri, 30 Oct 2020 17:16:37 +0000</pubDate>
</item>
<item>
<title>Answered: Improve error messages for clojure.core/case</title>
<link>https://ask.clojure.org/index.php/9152/improve-error-messages-for-clojure-core-case?show=9653#a9653</link>
<description>&lt;p&gt;Fixed in 1.10.2-alpha2&lt;/p&gt;
</description>
<category>Errors</category>
<guid isPermaLink="true">https://ask.clojure.org/index.php/9152/improve-error-messages-for-clojure-core-case?show=9653#a9653</guid>
<pubDate>Fri, 25 Sep 2020 19:21:27 +0000</pubDate>
</item>
<item>
<title>Answered: case has incorrect + difficult-to-comprehend behavior matching 'quote on Clojure 1.10.0</title>
<link>https://ask.clojure.org/index.php/9508/incorrect-difficult-comprehend-behavior-matching-clojure?show=9509#a9509</link>
<description>&lt;p&gt;This is the expected behavior per the docstring, not a bug.&lt;br&gt;
&lt;code&gt;'foo =&amp;gt; (quote foo)&lt;/code&gt;&lt;br&gt;
That happens in the reader and per the &lt;code&gt;case&lt;/code&gt; docstring you can have &lt;code&gt;(constant constant constant...)&lt;/code&gt; so this is the pair of constant symbols &lt;code&gt;quote&lt;/code&gt; and &lt;code&gt;foo&lt;/code&gt;.&lt;/p&gt;
&lt;p&gt;That's why your &lt;code&gt;case&lt;/code&gt; on the (evaluated) expression &lt;code&gt;'quote&lt;/code&gt; matches &lt;code&gt;'face&lt;/code&gt; because it's the pair of constant expressions &lt;code&gt;quote&lt;/code&gt; and &lt;code&gt;face&lt;/code&gt;.&lt;/p&gt;
&lt;p&gt;Similarly, &lt;code&gt;(symbol quote)&lt;/code&gt; is the pair of constant expressions &lt;code&gt;symbol&lt;/code&gt; and &lt;code&gt;quote&lt;/code&gt; (and, again, your test expression matches.&lt;/p&gt;
&lt;p&gt;From the docstring: &quot;The test-constants are not evaluated. They must be compile-time  literals, and need not be quoted.&quot;&lt;/p&gt;
&lt;p&gt;In case it is not clear from that, the reason &lt;code&gt;'quote&lt;/code&gt; is not legal is because the reader expands that to &lt;code&gt;(quote quote)&lt;/code&gt; and now you have a duplicate constant expression.&lt;/p&gt;
</description>
<category>Errors</category>
<guid isPermaLink="true">https://ask.clojure.org/index.php/9508/incorrect-difficult-comprehend-behavior-matching-clojure?show=9509#a9509</guid>
<pubDate>Sun, 26 Jul 2020 21:32:28 +0000</pubDate>
</item>
<item>
<title>Answered: Calling deref on &quot;clojure.core/*clojure-version*&quot; yields &quot;Unbound: #'clojure.core/*clojure-version*&quot;</title>
<link>https://ask.clojure.org/index.php/9404/calling-clojure-clojure-version-unbound-clojure-clojure?show=9405#a9405</link>
<description>&lt;p&gt;It sounds like Clojure itself has not been initialized on the path through your Java code to get to the above. That would also explain the &lt;code&gt;IllegalStateException&lt;/code&gt; from trying to use &lt;code&gt;requiring-resolve&lt;/code&gt; -- and you'll see that error from anything you try to reference.&lt;/p&gt;
&lt;p&gt;Without knowing more about how you built your Java program, it's hard to say what might cause this.&lt;/p&gt;
&lt;p&gt;Taking a look at this small repo might help you: &lt;a rel=&quot;nofollow&quot; href=&quot;https://github.com/stuarthalloway/clojure-from-java&quot;&gt;https://github.com/stuarthalloway/clojure-from-java&lt;/a&gt;&lt;/p&gt;
</description>
<category>Errors</category>
<guid isPermaLink="true">https://ask.clojure.org/index.php/9404/calling-clojure-clojure-version-unbound-clojure-clojure?show=9405#a9405</guid>
<pubDate>Tue, 23 Jun 2020 21:47:03 +0000</pubDate>
</item>
<item>
<title>Answered: How to display better errors in clojure stacktraces? is this planned to be attacked on a new clojure version?</title>
<link>https://ask.clojure.org/index.php/8343/display-clojure-stacktraces-planned-attacked-clojure-version?show=9306#a9306</link>
<description>&lt;p&gt;Here's another +1 for even better error message out of the box.&lt;/p&gt;
&lt;p&gt;The libraries mentioned below are treating the symptoms more or less successfully, but let's look at it from the point of someone wanting to learn Clojure, hence heads to Clojure.org, clicks on Getting Started. &lt;/p&gt;
&lt;p&gt;Ok, I now know how to download it. Maybe I'll try to get a feel for it by using &lt;code&gt;repl.it&lt;/code&gt;.&lt;br&gt;
 Now I have the bare bones experience (with the - according to clojure.org confusing error messages) (see : &quot;One confusing error you might see is the result of accidentally trying to evaluate a list of data as if it were code:&quot; ) &lt;/p&gt;
&lt;p&gt;Well, let's go to Learn Clojure first. &lt;br&gt;
Ok, still nothing about how to launch a REPL. &lt;br&gt;
Third link: Good idea to start a REPL. &lt;br&gt;
Fourth link: Here are the n ways to start a REPL. &lt;br&gt;
Here are other ways to run a REPL. &lt;/p&gt;
&lt;p&gt;None mention anything about: If you are a beginner, let's add clj-stacktrace, then start a REPL.&lt;br&gt;
Do you see why this is impractical? &lt;/p&gt;
&lt;p&gt;I know you have put a lot of effort into better docs in recent years and I feel bad pointing out these things. It is hard coming back to something so familiar and look at it through the eyes of a developer who wants to  learn about this new language. &lt;/p&gt;
&lt;p&gt;I believe you have 1 or maybe 2 shots at making a good impressions and readable error messages that tell you where you went wrong is an important part of that.  &lt;/p&gt;
&lt;p&gt;user=&amp;gt; (map 1 inc) &lt;br&gt;
Don't know how to create ISeq from: clojure.core$inc:&lt;/p&gt;
&lt;p&gt;user=&amp;gt; (1 2 3)&lt;br&gt;
Execution error (ClassCastException) at user/eval7 (REPL:1). class java.lang.Long cannot be cast to class clojure.lang.IFn (java.lang.Long is in module java.base of loader 'bootstrap'; clojure.lang.IFn is in unnamed module of loader 'app')&lt;/p&gt;
&lt;p&gt;Both don't tell me what I did wrong. It tells me some specifics of how the lisp evaluator works behind the scenes. (some of them are documented on clojure.org). &lt;/p&gt;
&lt;p&gt;Since none of this is helpful for me, the new user, I'm going to google it. &lt;br&gt;
The tolerance for googling error messages for errors like wrong argument order or invoking something that can't be invoked, is not very high for beginners. &lt;/p&gt;
&lt;p&gt;That is where you leave the impression that error messages guiding the user are not important.&lt;br&gt;
(btw, curiously, you are already handing (nil 2 3) pretty good and not throwing an NPE)&lt;/p&gt;
&lt;p&gt;This is where clojure (the implementation) actively contributes to the 'huge learning curve' meme.&lt;br&gt;
It doesn't matter that - after seeing this error often enough - I learned what it is. (with regards to Sean's comment). &lt;/p&gt;
&lt;p&gt;The damage is done.  &lt;/p&gt;
&lt;p&gt;Other Clojure dialects are doing a better job here. (CLJS and Sci, for example).&lt;/p&gt;
&lt;p&gt;Speaking of effort: There's an objection that providing better error messages would impact performance. If we are talking about exception handling here (and in both cases above we do),&lt;br&gt;
I'm not sure I understand where the performance impact is.&lt;br&gt;
Exception handling because an s-expr fails is not on the performance-critical path, I would think.&lt;br&gt;
Happy to better understand where the performance aspect comes into play.&lt;/p&gt;
&lt;p&gt;Also, just for the two sample error messages above, the effort to write them from the perspective of the user - not the system - is not very high. For one of them it means changing line 557 in RT.java &lt;/p&gt;
&lt;p&gt;Better error messages might mean catching lower-level exceptions, associating them with the current AST and re-throwing them with a message associated with the list element that generated the error.&lt;/p&gt;
&lt;p&gt;I would implore you to guide beginners to the very best REPL they can get.&lt;br&gt;
Make that the default in Getting Started and Learning Clojure.&lt;br&gt;
Then you can draw back the curtain and say: Ya know, underneath is IFn and ISeq and you might see Java stacktraces.&lt;/p&gt;
&lt;p&gt;There are so many new concepts to learn and understand when going down the Clojure path. Re-interpreting error messages shouldn't be one of them.&lt;/p&gt;
</description>
<category>Errors</category>
<guid isPermaLink="true">https://ask.clojure.org/index.php/8343/display-clojure-stacktraces-planned-attacked-clojure-version?show=9306#a9306</guid>
<pubDate>Sun, 17 May 2020 20:49:34 +0000</pubDate>
</item>
<item>
<title>Answered: Namespace.java: addAlias exception could be more informative</title>
<link>https://ask.clojure.org/index.php/8705/namespace-java-addalias-exception-could-more-informative?show=8706#a8706</link>
<description>&lt;p&gt;Example? Proposed change?&lt;/p&gt;
</description>
<category>Errors</category>
<guid isPermaLink="true">https://ask.clojure.org/index.php/8705/namespace-java-addalias-exception-could-more-informative?show=8706#a8706</guid>
<pubDate>Thu, 10 Oct 2019 16:54:31 +0000</pubDate>
</item>
<item>
<title>Answered: ex-str can be misleading when handling s/explain-data</title>
<link>https://ask.clojure.org/index.php/8313/ex-str-can-be-misleading-when-handling-s-explain-data?show=8314#a8314</link>
<description>&lt;p&gt;What's happening here is that you are accidentally creating the same exception object pattern that spec creates when there is a function spec failure during instrumentation (specifically a root cause ex-info whose ex-data is spec explain data). This is handled as a special case in the error printer.&lt;/p&gt;
&lt;p&gt;A workaround would be to avoid that pattern, for example by moving that data out of the root:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;(ex-info &quot;Data validation failed&quot; {:invalid (s/explain-data int? :a)})
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;I will think more about whether we can be more choosy about when this case is triggered in the error printer.&lt;/p&gt;
</description>
<category>Errors</category>
<guid isPermaLink="true">https://ask.clojure.org/index.php/8313/ex-str-can-be-misleading-when-handling-s-explain-data?show=8314#a8314</guid>
<pubDate>Fri, 02 Aug 2019 15:36:46 +0000</pubDate>
</item>
<item>
<title>Answered: How do I get a full stack trace instead of &quot;... 12 more&quot;?</title>
<link>https://ask.clojure.org/index.php/8207/how-do-i-get-a-full-stack-trace-instead-of-12-more?show=8208#a8208</link>
<description>&lt;p&gt;In this particular case, Leiningen is invoking clojure.main as a process and it's the subprocess JVM that is printing the (uncaught) error. &lt;/p&gt;
&lt;p&gt;You see two exceptions here - the thrown exception, then a nested cause exception. Java's exception printer will print the &quot;... 12 more&quot; for nested cause stacks when they are the same as the stack already printed in the exception higher in the chain. That is, the 12 more here are exactly the same stack trace lines already printed for the first exception. So, there actually is no more info to be had here - you already have it all.&lt;/p&gt;
&lt;p&gt;The key line here is the top line of the bottom-most (root) exception:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;at xinova.model$reload_dbs.invokeStatic(model.clj:78)
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;I don't know what the error is, but I'd guess it's likely there is a Java interop call being made on a nil reference. This is happening while loading the file.&lt;/p&gt;
&lt;p&gt;In Clojure 1.10.1, we have modified how uncaught exceptions going through clojure.main are reported. If you switch to that, you'll actually see just the exception message and a longer report that gets dumped to a temp file. &lt;/p&gt;
&lt;p&gt;As an aside, The top line  message you see here is &quot;Exception in thread &quot;main&quot; Syntax error compiling&quot; - that's actually misleading due to a subtle bug in the exception handling overhaul done in Clojure 1.10. I prepped a ticket and a patch for that earlier this week to fix it in Clojure 1.11 (see &lt;a rel=&quot;nofollow&quot; href=&quot;https://clojure.atlassian.net/projects/CLJ/issues/CLJ-2529&quot;&gt;CLJ-2529&lt;/a&gt;). Basically errors happening in load are mistakenly being reported as compiler exceptions. Doesn't change things too much, but this is an example.&lt;/p&gt;
</description>
<category>Errors</category>
<guid isPermaLink="true">https://ask.clojure.org/index.php/8207/how-do-i-get-a-full-stack-trace-instead-of-12-more?show=8208#a8208</guid>
<pubDate>Fri, 26 Jul 2019 20:01:11 +0000</pubDate>
</item>
<item>
<title>Answered: clojure.test/is + thrown-with-msg? error when caught exception message is nil</title>
<link>https://ask.clojure.org/index.php/4213/clojure-test-thrown-with-error-when-caught-exception-message?show=4288#a4288</link>
<description>Reference: &lt;a href=&quot;https://clojure.atlassian.net/browse/CLJ-2369&quot; rel=&quot;nofollow&quot; target=&quot;_blank&quot;&gt;https://clojure.atlassian.net/browse/CLJ-2369&lt;/a&gt; (reported by alex+import)</description>
<category>Errors</category>
<guid isPermaLink="true">https://ask.clojure.org/index.php/4213/clojure-test-thrown-with-error-when-caught-exception-message?show=4288#a4288</guid>
<pubDate>Wed, 26 Jun 2019 12:00:00 +0000</pubDate>
</item>
<item>
<title>Answered: Omit &quot;null&quot; Exception message from error output</title>
<link>https://ask.clojure.org/index.php/3832/omit-null-exception-message-from-error-output?show=4143#a4143</link>
<description>Reference: &lt;a href=&quot;https://clojure.atlassian.net/browse/CLJ-2402&quot; rel=&quot;nofollow&quot; target=&quot;_blank&quot;&gt;https://clojure.atlassian.net/browse/CLJ-2402&lt;/a&gt; (reported by bronsa)</description>
<category>Errors</category>
<guid isPermaLink="true">https://ask.clojure.org/index.php/3832/omit-null-exception-message-from-error-output?show=4143#a4143</guid>
<pubDate>Wed, 26 Jun 2019 12:00:00 +0000</pubDate>
</item>
<item>
<title>Answered: Multimethods don't have the correct method name in stacktraces.</title>
<link>https://ask.clojure.org/index.php/4231/multimethods-dont-have-the-correct-method-name-stacktraces?show=4350#a4350</link>
<description>Reference: &lt;a href=&quot;https://clojure.atlassian.net/browse/CLJ-2419&quot; rel=&quot;nofollow&quot; target=&quot;_blank&quot;&gt;https://clojure.atlassian.net/browse/CLJ-2419&lt;/a&gt; (reported by marc)</description>
<category>Errors</category>
<guid isPermaLink="true">https://ask.clojure.org/index.php/4231/multimethods-dont-have-the-correct-method-name-stacktraces?show=4350#a4350</guid>
<pubDate>Wed, 26 Jun 2019 12:00:00 +0000</pubDate>
</item>
<item>
<title>Answered: defprotocol should throw error when signatures include variable number of parameters</title>
<link>https://ask.clojure.org/index.php/4628/defprotocol-should-signatures-include-variable-parameters?show=4750#a4750</link>
<description>Reference: &lt;a href=&quot;https://clojure.atlassian.net/browse/CLJ-888&quot; rel=&quot;nofollow&quot; target=&quot;_blank&quot;&gt;https://clojure.atlassian.net/browse/CLJ-888&lt;/a&gt; (reported by glchapman)</description>
<category>Errors</category>
<guid isPermaLink="true">https://ask.clojure.org/index.php/4628/defprotocol-should-signatures-include-variable-parameters?show=4750#a4750</guid>
<pubDate>Wed, 26 Jun 2019 12:00:00 +0000</pubDate>
</item>
<item>
<title>Answered: Allow AssertionError messages for function :pre and :post conditions to be specified.</title>
<link>https://ask.clojure.org/index.php/4618/allow-assertionerror-messages-function-conditions-specified?show=4692#a4692</link>
<description>Reference: &lt;a href=&quot;https://clojure.atlassian.net/browse/CLJ-1817&quot; rel=&quot;nofollow&quot; target=&quot;_blank&quot;&gt;https://clojure.atlassian.net/browse/CLJ-1817&lt;/a&gt; (reported by alex+import)</description>
<category>Errors</category>
<guid isPermaLink="true">https://ask.clojure.org/index.php/4618/allow-assertionerror-messages-function-conditions-specified?show=4692#a4692</guid>
<pubDate>Wed, 26 Jun 2019 12:00:00 +0000</pubDate>
</item>
<item>
<title>Answered: Primitive type hints on function names should print error message</title>
<link>https://ask.clojure.org/index.php/4272/primitive-hints-function-names-should-print-error-message?show=4546#a4546</link>
<description>Reference: &lt;a href=&quot;https://clojure.atlassian.net/browse/CLJ-790&quot; rel=&quot;nofollow&quot; target=&quot;_blank&quot;&gt;https://clojure.atlassian.net/browse/CLJ-790&lt;/a&gt; (reported by alan@thinkrelevance.com)</description>
<category>Errors</category>
<guid isPermaLink="true">https://ask.clojure.org/index.php/4272/primitive-hints-function-names-should-print-error-message?show=4546#a4546</guid>
<pubDate>Wed, 26 Jun 2019 12:00:00 +0000</pubDate>
</item>
<item>
<title>Answered: Separate compiler exceptions into :compilation and :compile-syntax-check</title>
<link>https://ask.clojure.org/index.php/4249/separate-compiler-exceptions-compilation-compile-syntax?show=4421#a4421</link>
<description>Reference: &lt;a href=&quot;https://clojure.atlassian.net/browse/CLJ-2428&quot; rel=&quot;nofollow&quot; target=&quot;_blank&quot;&gt;https://clojure.atlassian.net/browse/CLJ-2428&lt;/a&gt; (reported by alexmiller)</description>
<category>Errors</category>
<guid isPermaLink="true">https://ask.clojure.org/index.php/4249/separate-compiler-exceptions-compilation-compile-syntax?show=4421#a4421</guid>
<pubDate>Wed, 26 Jun 2019 12:00:00 +0000</pubDate>
</item>
<item>
<title>Answered: Improve error message when calling a keyword with the wrong number of arguments</title>
<link>https://ask.clojure.org/index.php/4246/improve-error-message-calling-keyword-wrong-number-arguments?show=4394#a4394</link>
<description>Reference: &lt;a href=&quot;https://clojure.atlassian.net/browse/CLJ-2350&quot; rel=&quot;nofollow&quot; target=&quot;_blank&quot;&gt;https://clojure.atlassian.net/browse/CLJ-2350&lt;/a&gt; (reported by marc)</description>
<category>Errors</category>
<guid isPermaLink="true">https://ask.clojure.org/index.php/4246/improve-error-message-calling-keyword-wrong-number-arguments?show=4394#a4394</guid>
<pubDate>Wed, 26 Jun 2019 12:00:00 +0000</pubDate>
</item>
<item>
<title>Answered: Line numbers in stack trace are wrong when type hints satisfaction fails</title>
<link>https://ask.clojure.org/index.php/4215/line-numbers-stack-trace-wrong-when-hints-satisfaction-fails?show=4290#a4290</link>
<description>Reference: &lt;a href=&quot;https://clojure.atlassian.net/browse/CLJ-2274&quot; rel=&quot;nofollow&quot; target=&quot;_blank&quot;&gt;https://clojure.atlassian.net/browse/CLJ-2274&lt;/a&gt; (reported by alex+import)</description>
<category>Errors</category>
<guid isPermaLink="true">https://ask.clojure.org/index.php/4215/line-numbers-stack-trace-wrong-when-hints-satisfaction-fails?show=4290#a4290</guid>
<pubDate>Wed, 26 Jun 2019 12:00:00 +0000</pubDate>
</item>
<item>
<title>Answered: Unfriendly Java cast expection when *compile-path* is set incorrectly</title>
<link>https://ask.clojure.org/index.php/3788/unfriendly-java-cast-expection-when-compile-path-incorrectly?show=3919#a3919</link>
<description>Reference: &lt;a href=&quot;https://clojure.atlassian.net/browse/CLJ-2412&quot; rel=&quot;nofollow&quot; target=&quot;_blank&quot;&gt;https://clojure.atlassian.net/browse/CLJ-2412&lt;/a&gt; (reported by jeroen)</description>
<category>Errors</category>
<guid isPermaLink="true">https://ask.clojure.org/index.php/3788/unfriendly-java-cast-expection-when-compile-path-incorrectly?show=3919#a3919</guid>
<pubDate>Wed, 26 Jun 2019 12:00:00 +0000</pubDate>
</item>
<item>
<title>Provide guidance on configuring error printer for handling errors</title>
<link>https://ask.clojure.org/index.php/3785/provide-guidance-configuring-error-printer-handling-errors</link>
<description>As of Clojure 1.10.1-beta1, errors in non-REPL environments are handled with `ex-str`, which is nice because `ex-str` in turn calls `*explain-out*` which is user-configurable. &lt;br /&gt;
&lt;br /&gt;
However, there is not clear guidance on how best to configure `s/*explain-out*` such that this configuration will be run before other namespaces are loaded. Perhaps 'user.clj' is the correct place for this, but will that always be loaded for all non-REPL tasks?&lt;br /&gt;
&lt;br /&gt;
For instance, this code would set up Expound, but right now I'm not sure how to reliably run it before other namespaces load:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
(require '[expound.alpha :as expound] '[clojure.spec.alpha :as s])&lt;br /&gt;
(alter-var-root #'s/*explain-out* (constantly (expound/custom-printer {:print-specs? false :show-valid-values? true :theme :figwheel-theme})))&lt;br /&gt;
</description>
<category>Errors</category>
<guid isPermaLink="true">https://ask.clojure.org/index.php/3785/provide-guidance-configuring-error-printer-handling-errors</guid>
<pubDate>Wed, 03 Apr 2019 01:48:27 +0000</pubDate>
</item>
<item>
<title>Use &quot;constructor&quot; instead of &quot;ctor&quot; in Compiler error messages</title>
<link>https://ask.clojure.org/index.php/1922/use-constructor-instead-of-ctor-in-compiler-error-messages</link>
<description>&lt;p&gt;In this example:&lt;/p&gt;
&lt;p&gt;&lt;code&gt;user=&amp;gt; (java.net.URL. #_&quot;missing arg&quot;)
Syntax error (IllegalArgumentException) compiling new at (REPL:1:1).
No matching ctor found for class java.net.URL&lt;/code&gt;&lt;/p&gt;
&lt;p&gt;the use of &quot;ctor&quot; is confusing. It matches the code variable name, but the user isn't looking at that.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Patch:&lt;/strong&gt; CLJ-2445.patch - replace &quot;ctor&quot; with &quot;constructor&quot; in error messages.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Prescreened by:&lt;/strong&gt; Alex Miller&lt;/p&gt;
</description>
<category>Errors</category>
<guid isPermaLink="true">https://ask.clojure.org/index.php/1922/use-constructor-instead-of-ctor-in-compiler-error-messages</guid>
<pubDate>Mon, 26 Nov 2018 13:57:54 +0000</pubDate>
</item>
<item>
<title>Confusing function name suffixes in error messages</title>
<link>https://ask.clojure.org/index.php/3773/confusing-function-name-suffixes-in-error-messages</link>
<description>Some core function names are reported in error messages with an odd munging suffix.&lt;br /&gt;
&lt;br /&gt;
For example, when passing the wrong number of arguments to {{inc}}, {{assoc}}, and {{dissoc}}, each error message reports the function name differently:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
clj -Srepro -Sdeps '{:deps {org.clojure/clojure {:mvn/version &amp;quot;1.10.0-beta4&amp;quot;}}}'&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
user=&amp;gt; (inc)&lt;br /&gt;
Syntax error compiling inc at (1:1).&lt;br /&gt;
Wrong number of args (0) passed to: clojure.core/inc--inliner--5436&lt;br /&gt;
user=&amp;gt; (assoc)&lt;br /&gt;
Evaluation error (ArityException) at clojure.lang.AFn.throwArity (AFn.java:429).&lt;br /&gt;
Wrong number of args (0) passed to: clojure.core/assoc--5316&lt;br /&gt;
user=&amp;gt; (dissoc)&lt;br /&gt;
Evaluation error (ArityException) at clojure.lang.AFn.throwArity (AFn.java:429).&lt;br /&gt;
Wrong number of args (0) passed to: clojure.core/dissoc&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
From the user's point of view, this behaviour is unmotivated and confusing. Perhaps such names should be further demunged and printed without the suffix.</description>
<category>Errors</category>
<guid isPermaLink="true">https://ask.clojure.org/index.php/3773/confusing-function-name-suffixes-in-error-messages</guid>
<pubDate>Sat, 03 Nov 2018 13:01:54 +0000</pubDate>
</item>
<item>
<title>clojure.lang.ExceptionInfo should not pass null cause in its two-arg constructor</title>
<link>https://ask.clojure.org/index.php/2776/clojure-lang-exceptioninfo-should-pass-cause-constructor</link>
<description>&lt;p&gt;The two-arg constructor for clojure.lang.ExceptionInfo chains to the 3-arg version, passing null as the cause. The 3-arg constructor then calls super with the null cause, above which line is the comment &quot;null cause is equivalent to not passing a cause&quot;.&lt;/p&gt;
&lt;p&gt;This is not actually true, as passing null here means the cause has been initialised, regardless of value. As a consequence, you can not call .initCause on the ex-info exception later. In my case, the 'cause' is not known when thrown: the exception is caught upstack, the cause added, then rethrown.&lt;/p&gt;
&lt;p&gt;In summary, this expression will always throw an exception: (-&amp;gt; (ex-info &quot;ex&quot; {}) (.initCause (Exception. &quot;cause&quot;))).&lt;/p&gt;
&lt;p&gt;The simple solution would be to call the 2-arg super, and call .initCause if cause is non-null.&lt;/p&gt;
&lt;p&gt;Cheers,&lt;/p&gt;
&lt;p&gt;Matt.&lt;/p&gt;
</description>
<category>Errors</category>
<guid isPermaLink="true">https://ask.clojure.org/index.php/2776/clojure-lang-exceptioninfo-should-pass-cause-constructor</guid>
<pubDate>Sun, 11 Feb 2018 00:51:48 +0000</pubDate>
</item>
<item>
<title>When calling a multi method with the wrong number of arguments, the error message could be better.</title>
<link>https://ask.clojure.org/index.php/2803/calling-multi-method-wrong-number-arguments-message-better</link>
<description>&lt;br /&gt;
09:43 $ clj&lt;br /&gt;
Clojure 1.8.0&lt;br /&gt;
(defmulti foo :bar)&lt;br /&gt;
(defmethod foo :qix [quux znoot] (println 'hi))&lt;br /&gt;
#'user/foo&lt;br /&gt;
user=&amp;gt; #object[clojure.lang.MultiFn 0x205d38da &amp;quot;clojure.lang.MultiFn@205d38da&amp;quot;]&lt;br /&gt;
user=&amp;gt; (foo {:bar :qix})&lt;br /&gt;
ArityException Wrong number of args (1) passed to: user/eval5/fn--6 &amp;nbsp;clojure.lang.AFn.throwArity (AFn.java:429)&lt;br /&gt;
user=&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
It is an implementation detail that multi methods are implemented via anonymous functions. I would expect the error message to at least contain the name of the function that failed, in this case it should have been something like &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
ArityException Wrong number of args (1) passed to: user/eval5/foo--6 &amp;nbsp;clojure.lang.AFn.throwArity (AFn.java:429)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Several approaches can be taken here:&lt;br /&gt;
&lt;br /&gt;
The first (and simplest) is to change the definition of {{defmethod}} so that the anonymous function gets a name.&lt;br /&gt;
This leads to an error message like: &lt;br /&gt;
&lt;br /&gt;
user=&amp;gt; (defmulti foo :bar)&lt;br /&gt;
(defmethod foo :qix [quux znoot] (println 'hi))&lt;br /&gt;
(foo {:bar :qix})#'user/foo&lt;br /&gt;
user=&amp;gt; #object[clojure.lang.MultiFn 0x4e928fbf &amp;quot;clojure.lang.MultiFn@4e928fbf&amp;quot;]&lt;br /&gt;
user=&amp;gt;&lt;br /&gt;
ArityException Wrong number of args (1) passed to: user/eval5/foo--6 &amp;nbsp;clojure.lang.AFn.throwArity (AFn.java:429)&lt;br /&gt;
user=&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In addition to this, one could modify Compiler.java to look for the calls to &amp;quot;addMethod&amp;quot;&lt;br /&gt;
&lt;br /&gt;
String prefix = &amp;quot;eval&amp;quot;;&lt;br /&gt;
if (RT.count(form) &amp;gt; 2) {&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;Object third = RT.nth(form, 2);&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;if (third != null &amp;amp;&amp;amp;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;quot;clojure.core/addMethod&amp;quot;.equals(third.toString()))&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;prefix = &amp;quot;multi_fn&amp;quot;;&lt;br /&gt;
}&lt;br /&gt;
ObjExpr fexpr = (ObjExpr) analyze(C.EXPRESSION, RT.list(FN, PersistentVector.EMPTY, form), prefix + RT.nextID());&lt;br /&gt;
&lt;br /&gt;
which would give us error messages like&lt;br /&gt;
&lt;br /&gt;
ArityException Wrong number of args (1) passed to: user/multi-fn5/foo--6 &amp;nbsp;clojure.lang.AFn.throwArity (AFn.java:441)&lt;br /&gt;
</description>
<category>Errors</category>
<guid isPermaLink="true">https://ask.clojure.org/index.php/2803/calling-multi-method-wrong-number-arguments-message-better</guid>
<pubDate>Tue, 07 Nov 2017 15:10:17 +0000</pubDate>
</item>
<item>
<title>LispReader.java  and EdnReader.java exception messages could be much more informative.</title>
<link>https://ask.clojure.org/index.php/3364/lispreader-ednreader-exception-messages-could-informative</link>
<description>&lt;p&gt;The messages in the exceptions thrown by the readers would be much more informative if they included readily available information. There are many instances of this, but to name a few specific instances (all from LispReader.java, though there in most cases there are corresponding problems in EdnReader.java):&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;p&gt;If the RegexReader class hits an unexpected EOF, it reports &quot;EOF while reading regex&quot;. It would be helpful if the message included the first few characters of the regex it was trying to read -- available in sb -- as a guide to the person trying to locate the problem.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;&lt;p&gt;The same logic applies to StringReader.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;&lt;p&gt;In NamespaceMapReader, the error thrown if the namespaced map is not in fact a map could include the namespace symbol.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Whenever an odd number of elements in a map is detected, the exception could at least report the number of elements that the bad map did include, something like: &quot;Map literal cannot contain 7 forms. Map literals must contain an even number of forms.&quot; Even better would be the first few forms.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;&lt;p&gt;The &quot;Metadata can only be applied to IMetas&quot; exception in MetaReader is not nearly as helpful as it could be. At the very least it should report the class of the thing that is not an IMeta.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;&lt;p&gt;With an additional argument, readDelimitedList could report the kind of thing that it was reading in the event that it hit the EOF. Without the additional argument it still report that it hit an EOF while trying to read the first or 4th or 29 element of a collection.&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;
</description>
<category>Errors</category>
<guid isPermaLink="true">https://ask.clojure.org/index.php/3364/lispreader-ednreader-exception-messages-could-informative</guid>
<pubDate>Wed, 31 May 2017 20:13:55 +0000</pubDate>
</item>
</channel>
</rss>