Skip to content

Commit

Permalink
made ValidationErrors more verbose round 2
Browse files Browse the repository at this point in the history
  • Loading branch information
lengstrom committed May 31, 2022
1 parent 7165663 commit 5668d69
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
5 changes: 3 additions & 2 deletions fastargs/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
import json
import sys
import os
from xml.dom import ValidationErr

from terminaltables import SingleTable

Expand Down Expand Up @@ -182,8 +183,8 @@ def __getitem__(self, path):

try:
return param.validate(value)
except TypeError as e:
print(f'Issue when typechecking path {path}! Error below:')
except ValidationError as e:
print(f'Issue when typechecking argument psyh `{".".join(path)}`:')
raise e


Expand Down
1 change: 0 additions & 1 deletion fastargs/param.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ def __init__(self, checker, desc='', default=None, required=False,
self.section = None

def __str__(self):

result = ""

if self.required:
Expand Down

0 comments on commit 5668d69

Please sign in to comment.