edornd / argdantic

Typed command line interfaces with argparse and pydantic
MIT License
38 stars 4 forks source link

Better validation errors #22

Closed edornd closed 1 year ago

edornd commented 1 year ago

Problem ValidationErrors in pydantic provide information about the exception in a very structured way. This is nice, but printing the stack trace and the pseudocode related to the error is not a very good idea.

Expected behavior Exploit the (well) formatted exception provided by pydantic and provide a concise string through the parser.error function, to exit gracefully, while both keeping the terminal clean and the user informed.