Fork me on GitHub
Charlie Briggs12:08:56

Afternoon, I just ran into an issue using the latest versions of orchestra and expound together and wondered if anyone could help. I’ve added orchestra using

and then setup expound to catch exceptions and print them:
((expound/custom-printer {:theme :figwheel-theme}) (-> ex ex-data))
however orchestra is throwing on an internal expound spec when passing the data to print. Any ideas? orchestra spec error
 [{:path [:id],
   :reason "Insufficient input",
   :pred clojure.core/string?,
   :val (),
   :via [],
   :in []}],
 :clojure.spec.alpha/spec #object[clojure.spec.alpha$regex_spec_impl$reify__2509 0x6c28ecb7 "[email protected]"],
 :clojure.spec.alpha/value nil,
 :clojure.spec.alpha/fn org-api.get-identity-provider/get-all,
 :clojure.spec.alpha/args nil,
 :clojure.spec.alpha/failure :instrument,
 {:file "handler.clj", :line 68, :var-scope org-api.handler/fn--26001}}
orchestra expound error
2020-08-11 13:40:42.368 | ERROR | qtp225104551-20 | {:clojure.spec.alpha/problems [{:path [:spec-name :clojure.spec.alpha/pred], :pred #{:args :ret :fn :clojure.spec.alpha/pred}, :val :id, :via [], :in [1]} {:path [:spec-name :clojure.spec.alpha/nil], :pred nil?, :val :id, :via [], :in [1]}], :clojure.spec.alpha/spec #object[clojure.spec.alpha$regex_spec_impl$reify__2509 0x7d665d19 [email protected]], :clojure.spec.alpha/value ({:show-valid-values? false, :print-specs? true, :theme :figwheel-theme} :id nil [] nil), :clojure.spec.alpha/fn expound.alpha/value-in-context, :clojure.spec.alpha/args ({:show-valid-values? false, :print-specs? true, :theme :figwheel-theme} :id nil [] nil), :clojure.spec.alpha/failure :instrument, :orchestra.spec.test/caller {:file core.clj, :line 673, :var-scope clojure.core/apply}}
clojure.lang.ExceptionInfo: Call to #'expound.alpha/value-in-context did not conform to spec.


@charliebriggs I’m AFK today, but I can look tomorrow or Thursday. In the meantime, can you post the ex-data that is passed to expound?


As a workaround until there’s a fix, you could declare a new spec for “expound.alpha/value-in-context” (just allow any number of args) and see if that unblocks you.

Charlie Briggs15:08:46

Hey! The data is in the first code block above (“orchestra spec error”)


Ah, thanks! Totally missed that 😬


Does this reproduce if you don’t use orchestra and only use the default instrumentation?

Charlie Briggs15:08:55

just tried it, and it only seems to occur with orchestra

Charlie Briggs15:08:44

actually I think it may be more related to the spec I was varying on my server handlers to test this… I was changing the arity of :args which may be what has caused this, seems to work fine now when testing again just by changing spec defs. I might have wasted your time here! 😓


No problem, glad you got it figured out!