expound

Charlie Briggs 2020-08-11T12:50:56.011800Z

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

(stest/instrument)
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
{:clojure.spec.alpha/problems
 [{: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 "clojure.spec.alpha$regex_spec_impl$reify__2509@6c28ecb7"],
 :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,
 :orchestra.spec.test/caller
 {: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 clojure.spec.alpha$regex_spec_impl$reify__2509@7d665d19], :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.

bbrinck 2020-08-11T15:13:44.014100Z

@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?

bbrinck 2020-08-11T15:15:01.016400Z

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 Briggs 2020-08-11T15:16:46.016900Z

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

bbrinck 2020-08-11T15:19:38.017400Z

Ah, thanks! Totally missed that 😬

bbrinck 2020-08-11T15:22:18.018700Z

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

Charlie Briggs 2020-08-11T15:35:55.019200Z

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

Charlie Briggs 2020-08-11T15:41:44.020900Z

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! 😓

bbrinck 2020-08-11T16:46:07.021500Z

No problem, glad you got it figured out!