halst/schema — pull request #42 by chadrik (2014-04-25 22:33:45+00:00)
Title: Improve custom error handling.

The `Schema` 'error' kwarg now supports a callable, which returns the error message as a string. Its arguments are:
- `schema`: the underlying schema object
- `data`: the data being validated
- `reason`: a string constant for the type of error encountered
- `details`: further details about the reason for the failure. may be an exeption, a string, or None

Additionally, error strings passed to the `Schema` 'error' kwarg are now provided more context about the error in the form of four `{fields}` for use with "new-style" string formatting. These are string representations of the four arguments described above.