-
Notifications
You must be signed in to change notification settings - Fork 24
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
expound seems to print explain a problem twice whenever a compile time error is found #81
Comments
more info: This seems to be Clojure problem. Not sure if there is already a ticket for it though. Doing the same commands as above you still get 2 different errors in the repl
|
@carocad Thanks for reporting this. Yes, you're correct: this is an issue with the way Clojure prints out data when it sees an exception (and the information attached to an exception when instrumentation fails). I agree, it's very noisy and repetitive. Unfortunately, the expound printer can't control this directly. I'm not sure of the best fix here, but I seem to recall that it's possible to configure a REPL to install a different exception handler. I haven't tried this myself though. If you figure out a workaround in your environment, please let me know and I may add it to the docs! I'll also look into this myself at some point. |
@bhb after some comments in the slack channel it seems that this is not a Clojure problem but a Cursive/expound one. Clojure returns a single You can replicate this by doing
for the record I am putting here the result of the above command just in case we get different results 😆 #error{:cause "Call to clojure.core/let did not conform to spec:
In: [0 0] val: 1 fails spec: :clojure.core.specs.alpha/local-name at: [:args :bindings :binding :sym] predicate: simple-symbol?
In: [0 0] val: 1 fails spec: :clojure.core.specs.alpha/seq-binding-form at: [:args :bindings :binding :seq] predicate: vector?
In: [0 0] val: 1 fails spec: :clojure.core.specs.alpha/map-bindings at: [:args :bindings :binding :map] predicate: coll?
In: [0 0] val: 1 fails spec: :clojure.core.specs.alpha/map-special-binding at: [:args :bindings :binding :map] predicate: map?
",
:data #:clojure.spec.alpha{:problems ({:path [:args :bindings :binding :sym],
:pred clojure.core/simple-symbol?,
:val 1,
:via [:clojure.core.specs.alpha/bindings
:clojure.core.specs.alpha/bindings
:clojure.core.specs.alpha/binding
:clojure.core.specs.alpha/binding-form
:clojure.core.specs.alpha/binding-form
:clojure.core.specs.alpha/local-name],
:in [0 0]}
{:path [:args :bindings :binding :seq],
:pred clojure.core/vector?,
:val 1,
:via [:clojure.core.specs.alpha/bindings
:clojure.core.specs.alpha/bindings
:clojure.core.specs.alpha/binding
:clojure.core.specs.alpha/binding-form
:clojure.core.specs.alpha/binding-form
:clojure.core.specs.alpha/seq-binding-form],
:in [0 0]}
{:path [:args :bindings :binding :map],
:pred clojure.core/coll?,
:val 1,
:via [:clojure.core.specs.alpha/bindings
:clojure.core.specs.alpha/bindings
:clojure.core.specs.alpha/binding
:clojure.core.specs.alpha/binding-form
:clojure.core.specs.alpha/binding-form
:clojure.core.specs.alpha/map-binding-form
:clojure.core.specs.alpha/map-bindings],
:in [0 0]}
{:path [:args :bindings :binding :map],
:pred map?,
:val 1,
:via [:clojure.core.specs.alpha/bindings
:clojure.core.specs.alpha/bindings
:clojure.core.specs.alpha/binding
:clojure.core.specs.alpha/binding-form
:clojure.core.specs.alpha/binding-form
:clojure.core.specs.alpha/map-binding-form
:clojure.core.specs.alpha/map-special-binding],
:in [0 0]}),
:spec #object[clojure.spec.alpha$regex_spec_impl$reify__2436
0x122eca20
"clojure.spec.alpha$regex_spec_impl$reify__2436@122eca20"],
:value ([1 2]),
:args ([1 2])},
:via [{:type clojure.lang.Compiler$CompilerException,
:message "clojure.lang.ExceptionInfo: Call to clojure.core/let did not conform to spec:
In: [0 0] val: 1 fails spec: :clojure.core.specs.alpha/local-name at: [:args :bindings :binding :sym] predicate: simple-symbol?
In: [0 0] val: 1 fails spec: :clojure.core.specs.alpha/seq-binding-form at: [:args :bindings :binding :seq] predicate: vector?
In: [0 0] val: 1 fails spec: :clojure.core.specs.alpha/map-bindings at: [:args :bindings :binding :map] predicate: coll?
In: [0 0] val: 1 fails spec: :clojure.core.specs.alpha/map-special-binding at: [:args :bindings :binding :map] predicate: map?
#:clojure.spec.alpha{:problems ({:path [:args :bindings :binding :sym], :pred clojure.core/simple-symbol?, :val 1, :via [:clojure.core.specs.alpha/bindings :clojure.core.specs.alpha/bindings :clojure.core.specs.alpha/binding :clojure.core.specs.alpha/binding-form :clojure.core.specs.alpha/binding-form :clojure.core.specs.alpha/local-name], :in [0 0]} {:path [:args :bindings :binding :seq], :pred clojure.core/vector?, :val 1, :via [:clojure.core.specs.alpha/bindings :clojure.core.specs.alpha/bindings :clojure.core.specs.alpha/binding :clojure.core.specs.alpha/binding-form :clojure.core.specs.alpha/binding-form :clojure.core.specs.alpha/seq-binding-form], :in [0 0]} {:path [:args :bindings :binding :map], :pred clojure.core/coll?, :val 1, :via [:clojure.core.specs.alpha/bindings :clojure.core.specs.alpha/bindings :clojure.core.specs.alpha/binding :clojure.core.specs.alpha/binding-form :clojure.core.specs.alpha/binding-form :clojure.core.specs.alpha/map-binding-form :clojure.core.specs.alpha/map-bindings], :in [0 0]} {:path [:args :bindings :binding :map], :pred map?, :val 1, :via [:clojure.core.specs.alpha/bindings :clojure.core.specs.alpha/bindings :clojure.core.specs.alpha/binding :clojure.core.specs.alpha/binding-form :clojure.core.specs.alpha/binding-form :clojure.core.specs.alpha/map-binding-form :clojure.core.specs.alpha/map-special-binding], :in [0 0]}), :spec #object[clojure.spec.alpha$regex_spec_impl$reify__2436 0x122eca20 \"clojure.spec.alpha$regex_spec_impl$reify__2436@122eca20\"], :value ([1 2]), :args ([1 2])}, compiling:(/Users/Camilo/Proyectos/kamal/src/hiposfer/kamal/dev.clj:56:1)",
:at [clojure.lang.Compiler checkSpecs "Compiler.java" 6891]}
{:type clojure.lang.ExceptionInfo,
:message "Call to clojure.core/let did not conform to spec:
In: [0 0] val: 1 fails spec: :clojure.core.specs.alpha/local-name at: [:args :bindings :binding :sym] predicate: simple-symbol?
In: [0 0] val: 1 fails spec: :clojure.core.specs.alpha/seq-binding-form at: [:args :bindings :binding :seq] predicate: vector?
In: [0 0] val: 1 fails spec: :clojure.core.specs.alpha/map-bindings at: [:args :bindings :binding :map] predicate: coll?
In: [0 0] val: 1 fails spec: :clojure.core.specs.alpha/map-special-binding at: [:args :bindings :binding :map] predicate: map?
",
:data #:clojure.spec.alpha{:problems ({:path [:args :bindings :binding :sym],
:pred clojure.core/simple-symbol?,
:val 1,
:via [:clojure.core.specs.alpha/bindings
:clojure.core.specs.alpha/bindings
:clojure.core.specs.alpha/binding
:clojure.core.specs.alpha/binding-form
:clojure.core.specs.alpha/binding-form
:clojure.core.specs.alpha/local-name],
:in [0 0]}
{:path [:args :bindings :binding :seq],
:pred clojure.core/vector?,
:val 1,
:via [:clojure.core.specs.alpha/bindings
:clojure.core.specs.alpha/bindings
:clojure.core.specs.alpha/binding
:clojure.core.specs.alpha/binding-form
:clojure.core.specs.alpha/binding-form
:clojure.core.specs.alpha/seq-binding-form],
:in [0 0]}
{:path [:args :bindings :binding :map],
:pred clojure.core/coll?,
:val 1,
:via [:clojure.core.specs.alpha/bindings
:clojure.core.specs.alpha/bindings
:clojure.core.specs.alpha/binding
:clojure.core.specs.alpha/binding-form
:clojure.core.specs.alpha/binding-form
:clojure.core.specs.alpha/map-binding-form
:clojure.core.specs.alpha/map-bindings],
:in [0 0]}
{:path [:args :bindings :binding :map],
:pred map?,
:val 1,
:via [:clojure.core.specs.alpha/bindings
:clojure.core.specs.alpha/bindings
:clojure.core.specs.alpha/binding
:clojure.core.specs.alpha/binding-form
:clojure.core.specs.alpha/binding-form
:clojure.core.specs.alpha/map-binding-form
:clojure.core.specs.alpha/map-special-binding],
:in [0 0]}),
:spec #object[clojure.spec.alpha$regex_spec_impl$reify__2436
0x122eca20
"clojure.spec.alpha$regex_spec_impl$reify__2436@122eca20"],
:value ([1 2]),
:args ([1 2])},
:at [clojure.core$ex_info invokeStatic "core.clj" 4739]}],
:trace [[clojure.core$ex_info invokeStatic "core.clj" 4739]
[clojure.core$ex_info invoke "core.clj" 4739]
[clojure.spec.alpha$macroexpand_check invokeStatic "alpha.clj" 689]
[clojure.spec.alpha$macroexpand_check invoke "alpha.clj" 681]
[clojure.lang.AFn applyToHelper "AFn.java" 156]
[clojure.lang.AFn applyTo "AFn.java" 144]
[clojure.lang.Var applyTo "Var.java" 702]
[clojure.lang.Compiler checkSpecs "Compiler.java" 6889]
[clojure.lang.Compiler macroexpand1 "Compiler.java" 6907]
[clojure.lang.Compiler macroexpand "Compiler.java" 6972]
[clojure.lang.Compiler eval "Compiler.java" 7046]
[clojure.lang.Compiler load "Compiler.java" 7514]
[hiposfer.kamal.core$eval24441 invokeStatic "form-init4756483243476288592.clj" 1]
[hiposfer.kamal.core$eval24441 invoke "form-init4756483243476288592.clj" 1]
[clojure.lang.Compiler eval "Compiler.java" 7062]
[clojure.lang.Compiler eval "Compiler.java" 7025]
[clojure.core$eval invokeStatic "core.clj" 3206]
[clojure.core$eval invoke "core.clj" 3202]
[clojure.main$repl$read_eval_print__8572$fn__8575 invoke "main.clj" 243]
[clojure.main$repl$read_eval_print__8572 invoke "main.clj" 243]
[clojure.main$repl$fn__8581 invoke "main.clj" 261]
[clojure.main$repl invokeStatic "main.clj" 261]
[clojure.main$repl doInvoke "main.clj" 177]
[clojure.lang.RestFn invoke "RestFn.java" 1523]
[clojure.tools.nrepl.middleware.interruptible_eval$evaluate$fn__21980 invoke "interruptible_eval.clj" 87]
[clojure.lang.AFn applyToHelper "AFn.java" 152]
[clojure.lang.AFn applyTo "AFn.java" 144]
[clojure.core$apply invokeStatic "core.clj" 657]
[clojure.core$with_bindings_STAR_ invokeStatic "core.clj" 1965]
[clojure.core$with_bindings_STAR_ doInvoke "core.clj" 1965]
[clojure.lang.RestFn invoke "RestFn.java" 425]
[clojure.tools.nrepl.middleware.interruptible_eval$evaluate invokeStatic "interruptible_eval.clj" 85]
[clojure.tools.nrepl.middleware.interruptible_eval$evaluate invoke "interruptible_eval.clj" 55]
[clojure.tools.nrepl.middleware.interruptible_eval$interruptible_eval$fn__22025$fn__22028
invoke
"interruptible_eval.clj"
222]
[clojure.tools.nrepl.middleware.interruptible_eval$run_next$fn__22020
invoke
"interruptible_eval.clj"
190]
[clojure.lang.AFn run "AFn.java" 22]
[java.util.concurrent.ThreadPoolExecutor runWorker "ThreadPoolExecutor.java" 1142]
[java.util.concurrent.ThreadPoolExecutor$Worker run "ThreadPoolExecutor.java" 617]
[java.lang.Thread run "Thread.java" 745]]} As you can see this is a single exception but contains 2 different exceptions inside which is what I think might be causing the problem. Hope it helps |
@carocad Thanks for looking into this! I can replicate the same results as you, so we're on the same page 😄
Unfortunately, I don't think Expound can resolve this. Expound is just a replacement for the default spec printer, but it doesn't control the exception that is thrown, or how exceptions are displayed. AIUI, this is controlled by REPL configuration (in your case, Cursive may be controlling this, or perhaps some third-party library like pretty). For example, here's a REPL with Expound that uses (start with
By any chance does your project load "pretty" or another library that displays errors differently? What happens if you disable those? |
I don't use boot myself, but I found this note on the pretty page:
https://github.com/AvisoNovate/pretty Does your REPL happen to be started by boot? If so, it may be setting up this exception printing by default. |
@bhb yes I am using Thanks for looking into this, I will mention it in their repo to get some help |
@carocad Thanks for bringing this to my attention. I'm going to close this for now since I don't think expound can fix this, but please reopen if you discover something different 😄 |
with the following setup in v0.5.1-snaptshot
Given that Clojure specs are quite complex the error message is equally large. Having it twice definitely doesnt help.
However the output from Expound is very organized so the problem becomes very manageable.
Hope it helps
The text was updated successfully, but these errors were encountered: