Undefined variable in
Custom Coercers snippet from documentation
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 :) .
The text was updated successfully, but these errors were encountered:
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.