Skip to content

Commit

Permalink
runtyime type checking error example
Browse files Browse the repository at this point in the history
  • Loading branch information
keithasaurus committed Sep 28, 2023
1 parent d1cf8d8 commit ec805dc
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@ class Person(TypedDict):
person_validator = TypedDictValidator(Person)

# Produce readable errors

match person_validator({"name": "Guido"}):
case Valid(string_list):
print(f"woohoo, valid!")
Expand All @@ -45,6 +44,16 @@ list_string_validator = ListValidator(string_validator)
def add(a: int, b: int) -> int:
return a + b


add(1, 2) # returns 3

add(1, "2") # raises `InvalidArgsError`
# koda_validate.signature.InvalidArgsError:
# Invalid Argument Values
# -----------------------
# b='2'
# expected <class 'int'>

```

There's much, much more... Check out the [Docs](https://koda-validate.readthedocs.io/en/stable/).
Expand Down

0 comments on commit ec805dc

Please sign in to comment.