metosin / malli

High-performance data-driven data specification library for Clojure/Script.
Eclipse Public License 2.0
1.44k stars 204 forks source link

mx/defn + pretty thrower = Exception message always says 'nil' in 'Function Var' #934

Open jasonjckn opened 10 months ago

jasonjckn commented 10 months ago

Steps to repro

(malli.dev/start! {:report (m.x.virhe/pretty-thrower (m.x.virhe/-pretty-printer {}))})
(malli.experimental/defn foo [x :- int?] 3)
(foo "hi")

The error message for me looks like

1. Unhandled clojure.lang.ExceptionInfo
   -- Schema Error ----------------------------------------------------------- metta.auxiliary.malli.virhe:139
   --

   Invalid function arguments:

     ["hi"]

   Function Var:

     nil

   Input Schema:

     [:cat int?]

   Errors:

     {:in [0], :message "should be an int", :path [0], :schema int?, :value "hi"}

   More information:

     https://cljdoc.org/d/metosin/malli/CURRENT/doc/function-schemas

Function Var should not be nil here.

Am using metosin/malli {:mvn/version "0.11.0"}