phel-lang / phel-schema

Schema validation library in phel. The library inspired by zod
MIT License
2 stars 0 forks source link

Showing validation issue details in REPL #4

Open jasalt opened 3 days ago

jasalt commented 3 days ago

I had trouble in REPL not seeing any more detailed validation issue information than just ZodError without any message.

If I understood, the thrown ZodError exception would have to be caught and handled, or safe-parse output be checked instead, both manually, making interactive development not so convenient with the library.

I did not save a screenshot or anything as I was in a hurry switching from the library to a DIY solution, but can add extra details about reproducing if it can be of help.

smeghead commented 23 hours ago

@jasalt Thank you. Currently, the exception message is a fixed string “Zod Error”. Certainly there is not enough information in the REPL. Are you saying that you expected the exception message to be a description of the error?

jasalt commented 18 hours ago

Are you saying that you expected the exception message to be a description of the error?

@smeghead I'm not sure how much is correct to put into exception message. However, some way to provide detailed info in REPL would be useful.

Example of some Clojure Malli Schema error output https://github.com/metabase/metabase/wiki/Backend:-Metabase-Malli-Cheatsheet#validation.