{"action":"created","issue":{"url":"https://api.github.com/repos/LightTable/Clojure/issues/77","repository_url":"https://api.github.com/repos/LightTable/Clojure","labels_url":"https://api.github.com/repos/LightTable/Clojure/issues/77/labels{/name}","comments_url":"https://api.github.com/repos/LightTable/Clojure/issues/77/comments","events_url":"https://api.github.com/repos/LightTable/Clojure/issues/77/events","html_url":"https://github.com/LightTable/Clojure/issues/77","id":132717086,"number":77,"title":"better error messages","user":{"login":"carocad","id":10408729,"avatar_url":"https://avatars.githubusercontent.com/u/10408729?v=3","gravatar_id":"","url":"https://api.github.com/users/carocad","html_url":"https://github.com/carocad","followers_url":"https://api.github.com/users/carocad/followers","following_url":"https://api.github.com/users/carocad/following{/other_user}","gists_url":"https://api.github.com/users/carocad/gists{/gist_id}","starred_url":"https://api.github.com/users/carocad/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/carocad/subscriptions","organizations_url":"https://api.github.com/users/carocad/orgs","repos_url":"https://api.github.com/users/carocad/repos","events_url":"https://api.github.com/users/carocad/events{/privacy}","received_events_url":"https://api.github.com/users/carocad/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":19,"created_at":"2016-02-10T14:44:02Z","updated_at":"2016-04-06T14:35:42Z","closed_at":null,"body":"Hey guys,\r\nI was checking around what I thought was normal behavior for clojure and found out that it is probably a Lighttable thing. My problem is that any error that occurs in Lighttable creates a stack trace which is unreadable. For example:\r\n```\r\n(filter #() [1 2 3 4])\r\n```\r\non the REPL produces:\r\n```\r\nArityException Wrong number of args (1) passed to: core/eval21331/fn--21332  clojure.lang.AFn.throwArity (AFn.java:429)\r\n```\r\nWhereas on my Lighttable produces:\r\n```\r\nclojure.lang.ArityException: Wrong number of args (1) passed to: core/eval5308/fn--5309\r\n             AFn.java:429 clojure.lang.AFn.throwArity\r\n              AFn.java:32 clojure.lang.AFn.invoke\r\n            core.clj:2601 clojure.core/filter[fn]\r\n          LazySeq.java:40 clojure.lang.LazySeq.sval\r\n          LazySeq.java:49 clojure.lang.LazySeq.seq\r\n              RT.java:484 clojure.lang.RT.seq\r\n             core.clj:133 clojure.core/seq\r\n        core_print.clj:46 clojure.core/print-sequential\r\n       core_print.clj:147 clojure.core/fn\r\n         MultiFn.java:231 clojure.lang.MultiFn.invoke\r\n            core.clj:3392 clojure.core/pr-on\r\n            core.clj:3404 clojure.core/pr\r\n             AFn.java:154 clojure.lang.AFn.applyToHelper\r\n          RestFn.java:132 clojure.lang.RestFn.applyTo\r\n             core.clj:624 clojure.core/apply\r\n            core.clj:4373 clojure.core/pr-str\r\n          RestFn.java:408 clojure.lang.RestFn.invoke\r\n              eval.clj:68 lighttable.nrepl.eval/clean-serialize\r\n          RestFn.java:423 clojure.lang.RestFn.invoke\r\n              eval.clj:81 lighttable.nrepl.eval/->result\r\n             AFn.java:156 clojure.lang.AFn.applyToHelper\r\n             AFn.java:144 clojure.lang.AFn.applyTo\r\n             core.clj:626 clojure.core/apply\r\n            core.clj:2468 clojure.core/partial[fn]\r\n          RestFn.java:408 clojure.lang.RestFn.invoke\r\n            core.clj:2559 clojure.core/map[fn]\r\n          LazySeq.java:40 clojure.lang.LazySeq.sval\r\n          LazySeq.java:49 clojure.lang.LazySeq.seq\r\n              RT.java:484 clojure.lang.RT.seq\r\n             core.clj:133 clojure.core/seq\r\n            core.clj:2595 clojure.core/filter[fn]\r\n          LazySeq.java:40 clojure.lang.LazySeq.sval\r\n          LazySeq.java:49 clojure.lang.LazySeq.seq\r\n             Cons.java:39 clojure.lang.Cons.next\r\n              RT.java:598 clojure.lang.RT.next\r\n              core.clj:64 clojure.core/next\r\n            core.clj:2856 clojure.core/dorun\r\n            core.clj:2871 clojure.core/doall\r\n             eval.clj:125 lighttable.nrepl.eval/eval-clj\r\n          RestFn.java:442 clojure.lang.RestFn.invoke\r\n             eval.clj:191 lighttable.nrepl.eval/eval2119[fn]\r\n             AFn.java:152 clojure.lang.AFn.applyToHelper\r\n             AFn.java:144 clojure.lang.AFn.applyTo\r\n             core.clj:624 clojure.core/apply\r\n            core.clj:1862 clojure.core/with-bindings*\r\n          RestFn.java:425 clojure.lang.RestFn.invoke\r\n             eval.clj:176 lighttable.nrepl.eval/eval2119[fn]\r\n             eval.clj:175 lighttable.nrepl.eval/eval2119[fn]\r\n         MultiFn.java:227 clojure.lang.MultiFn.invoke\r\n              core.clj:97 lighttable.nrepl.core/queued[fn]\r\n            core.clj:2402 clojure.core/comp[fn]\r\ninterruptible_eval.clj:159 clojure.tools.nrepl.middleware.interruptible-eval/run-next[fn]\r\n              AFn.java:22 clojure.lang.AFn.run\r\nThreadPoolExecutor.java:1145 java.util.concurrent.ThreadPoolExecutor.runWorker\r\nThreadPoolExecutor.java:615 java.util.concurrent.ThreadPoolExecutor$Worker.run\r\n          Thread.java:745 java.lang.Thread.run\r\n```\r\n\r\nI don't know if this behavior is only on my Lighttable version but I guess not.\r\nOn the other hand I saw that you use clj-stacktrace in [nrepl/exception.clj](https://github.com/LightTable/Clojure/blob/master/lein-light-nrepl/src/lighttable/nrepl/exception.clj) which is a user specific code. Have you checked [clojure.stacktrace](https://clojure.github.io/clojure/clojure.stacktrace-api.html) from Clojure itself?\r\nIn tryclojure they use it and it is extremely simple; you can see the relevant lines [here](https://github.com/Raynes/tryclojure/blob/master/src/tryclojure/models/eval.clj#L34-L40)\r\n\r\nLet me know your thoughts about it"},"comment":{"url":"https://api.github.com/repos/LightTable/Clojure/issues/comments/206404810","html_url":"https://github.com/LightTable/Clojure/issues/77#issuecomment-206404810","issue_url":"https://api.github.com/repos/LightTable/Clojure/issues/77","id":206404810,"user":{"login":"carocad","id":10408729,"avatar_url":"https://avatars.githubusercontent.com/u/10408729?v=3","gravatar_id":"","url":"https://api.github.com/users/carocad","html_url":"https://github.com/carocad","followers_url":"https://api.github.com/users/carocad/followers","following_url":"https://api.github.com/users/carocad/following{/other_user}","gists_url":"https://api.github.com/users/carocad/gists{/gist_id}","starred_url":"https://api.github.com/users/carocad/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/carocad/subscriptions","organizations_url":"https://api.github.com/users/carocad/orgs","repos_url":"https://api.github.com/users/carocad/repos","events_url":"https://api.github.com/users/carocad/events{/privacy}","received_events_url":"https://api.github.com/users/carocad/received_events","type":"User","site_admin":false},"created_at":"2016-04-06T14:35:42Z","updated_at":"2016-04-06T14:35:42Z","body":"hey guys @kenny-evitt @rundis,\r\nas I mentioned on gitter I thought that using aviso/pretty could be pretty trivial and I was right :)\r\n\r\nHere is a [gist](https://gist.github.com/carocad/3a6d7bb15dc7327ba721c5e621274800) with the change proposal to replace clj-stacktrace with aviso/pretty. I think that all functionality would remain the same since I only touched the stacktrace-string parsing part.\r\n\r\nNevertheless I would like to know your opinion about it, you know more about it than me anyway ;)\r\n\r\nHere is a snapshot of the result. PS: I avoided putting colors to the output as that would require quite some more effort and possibly create a dependency between how are stacktraces parsed in `lein-light-nrepl` vs how are they displayed by the `clojure plugin`\r\n![captura de pantalla de 2016-04-06 16 29 59](https://cloud.githubusercontent.com/assets/10408729/14320378/1de9193c-fc15-11e5-8c2a-4afc33b1cc7f.png)\r\n![captura de pantalla de 2016-04-06 16 30 13](https://cloud.githubusercontent.com/assets/10408729/14320388/26f44a7e-fc15-11e5-88be-3a3bfd1081f7.png)\r\n"}}