Error handling and Zpublisher type casts ?
Hallo ! I would like to ask how I can catch an error produced by a Zpublisher type cast. If I have an zpt with a html form with input box <input type="text" name="number:int"> then the Zpublisher tries to convert the string I typed in into an integer number. If this fails, e.g. if I type in an string "aaa" that cannot be converted instead of a number "123", then I get this error: Zope Error Zope has encountered an error while publishing this resource. Error Type: ValueError Error Value: An integer was expected in the value 'aaa' How can I catch this error ? Thank you Andreas Martin
Andreas Martin writes:
I would like to ask how I can catch an error produced by a Zpublisher type cast. I fear, you cannot...
You may be able to do something about them in a custom "standard_error_message". One way to go is to not use ZPublisher type casts and do the casting in your application. The "Formulator" product may help you with validation and maybe casting. Dieter
participants (2)
-
Andreas Martin -
Dieter Maurer