Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.Sign up
Undefined variable in `Custom Coercers` snippet from documentation #285
Used Cerberus version: 1.0.1
I want to be able to set finer error messages when defining custom coercers.
Support request / Bug report
Here is the excerpt from the documentation (http://docs.python-cerberus.org/en/latest/customize.html#custom-coercers):
This code snippet can't work since
Ideally, I would like to be able to define custom error messages in coercers, and generally be finer in the way that I handle my error messages using Cerberus. I have already encountered the same kind of limitation with 1.x custom types. In 0.9, there was no limitation in this regard (
Many thanks for the amazing work :) .
yes, it's a docs issue. i guess the example was just adjusted to fit the methods' signatures over the time. the try/except-block is redundant.
this has nothing to do with the changed logic how types are checked. (if you want a type check with a custom error, do a custom rule.)
the normalization part could be smarter, sure.