Note that there are some explanatory texts on larger screens.

plurals
  1. POHow to get Clojure exception notification when they happen on the EDT?
    primarykey
    data
    text
    <p>I've just been scratching my hairs for a long time with an error I couldn't find. It turned out to be an arity exception but apparently because it happened on the EDT I couldn't "see" it. It didn't show in the "lein run" terminal when run from a terminal and it didn't show in any Emacs buffer when run from Emacs.</p> <p>After a very long time I ended up doing this:</p> <pre><code>(try (function-call-with-arity-error ...) (catch Exception e (println e) </code></pre> <p>and, at last, thanks to this, I got to see this printed:</p> <pre><code>#&lt;ArityException clojure.lang.ArityException: wrong number of args passed to... </code></pre> <p>and hence I've been able to find my error.</p> <p>And if I do this:</p> <pre><code>(do (println "trying...") (arity-error-here-on-purpose) ; this ones throws the arity error (println "done") ) </code></pre> <p>Then the terminal prints <em>"trying..."</em> but never gets to <em>"done..."</em>.</p> <p>I tried setting a default uncaught exception handler: the exception isn't getting caught. It's as if the program or the EDT was "stuck" after the arity exception (without printing anything anywhere).</p> <p>How am I suppose to deal with this the next time? Because I couldn't see any message anywhere it took me a really long time to find. Once again: nothing in the 'lein run' terminal and nothing in any Emacs buffer.</p> <p>Should I create a function that wraps calls that should happen on the EDT inside try / catch manually and that then logs/println the exception?</p> <p>Also note that this is in a relatively "long" Clojure app: 1000 lines of code, so I can't paste it here and I couldn't reproduce that behavior in a short example (but it happens consistently in my app).</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload