Add stronger validationt to auth/register rpc methods

This commit is contained in:
Andrey Antukh
2023-07-04 13:36:14 +02:00
parent 068d2f13f4
commit be652b909e
5 changed files with 61 additions and 41 deletions

View File

@@ -14,6 +14,7 @@
[app.common.pages :as cp]
[app.common.pprint :as pp]
[app.common.spec :as us]
[app.common.schema :as sm]
[app.common.uuid :as uuid]
[app.config :as cf]
[app.db :as db]
@@ -414,6 +415,14 @@
(println
(us/pretty-explain data))
(= :params-validation (:code data))
(app.common.pprint/pprint
(sm/humanize-data (::sm/explain data)))
(= :data-validation (:code data))
(app.common.pprint/pprint
(sm/humanize-data (::sm/explain data)))
(= :service-error (:type data))
(print-error! (.getCause ^Throwable error))