-
Notifications
You must be signed in to change notification settings - Fork 18
Open
Description
If you have a plugin that does not pass the schema check (missing ::dsp/name or ::dsp/doc for example), the resulting error is not very helpful.
Simple repro:
(require '[donut.system :as ds])
(ds/start {::ds/defs {:foo {::ds/start (fn [_])}}
::ds/plugins [{::ds/system-update (fn [s] s)}]})Results in the exception:
1. Unhandled clojure.lang.ExceptionInfo
:donut.system/invalid-system
{:explanation {:schema [:map
[:donut.system/defs
...]],
:value nil,
:errors ({:path [],
:in [],
:schema [:map
[:donut.system/defs
...]],
:value nil,
:type :malli.core/invalid-type})},
:explanation-human ["invalid type"],
:donut.error/url "https://donut.party/errors/#:donut.system_invalid-system",
:donut.error/id :donut.system/invalid-system}
system.cljc: 887 donut.system$signal/invokeStatic
system.cljc: 885 donut.system$signal/invoke
system.cljc: 993 donut.system$start/invokeStatic
system.cljc: 991 donut.system$start/invoke
REPL: 17 myns.core/eval91514
Specifically under :explanation-human "invalid type" message is not helpful, and under :explanation the :path is [] and :value is nil, so it is not at all easy to figure out where exactly the problem is.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels