diff --git a/README.rst b/README.rst index 0c70c0b..8b6baa6 100644 --- a/README.rst +++ b/README.rst @@ -456,10 +456,10 @@ instead of a built-in one. .. code:: python - >>> Schema(Use(int, error='Invalid year')).validate('XVII') + >>> Schema(Use(int, error='Invalid year {}')).validate('XVII') Traceback (most recent call last): ... - schema.SchemaError: Invalid year + schema.SchemaError: Invalid year XVII You can see all errors that occurred by accessing exception's ``exc.autos`` for auto-generated error messages, and ``exc.errors`` for errors @@ -469,6 +469,7 @@ You can exit with ``sys.exit(exc.code)`` if you want to show the messages to the user without traceback. ``error`` messages are given precedence in that case. + A JSON API example -------------------------------------------------------------------------------