diff --git a/src/zope/formlib/errors.rst b/src/zope/formlib/errors.rst index 6f60521..b313855 100644 --- a/src/zope/formlib/errors.rst +++ b/src/zope/formlib/errors.rst @@ -1,14 +1,17 @@ -Error handling -============== +================ + Error handling +================ + +.. currentmodule:: zope.formlib.interfaces These are a couple of functional tests that were written on-the-go ... In the future this might become more extensive ... Displaying invalidation errors ------------------------------- +============================== Validation errors, e.g. cause by invariants, are converted into readable text -by adapting them to IWidgetInputErrorView: +by adapting them to `IWidgetInputErrorView`: >>> from zope.publisher.browser import TestRequest >>> from zope.interface.exceptions import Invalid @@ -20,7 +23,7 @@ by adapting them to IWidgetInputErrorView: >>> message u'You are wrong!' -Interface invariant methods raise zope.interface.Invalid exception. Test if +Interface invariant methods raise `zope.interface.Invalid` exception. Test if this exception gets handled by the error_views. >>> myError = Invalid('My error message') @@ -54,9 +57,9 @@ And yes, we can even handle an i18n message in an Invalid exception: u'[[my.domain][My i18n error message]]' Displaying widget input errors ------------------------------- +============================== -WidgetInputError exceptions also work with i18n messages: +`WidgetInputError` exceptions also work with i18n messages: >>> from zope.formlib.interfaces import WidgetInputError >>> myError = WidgetInputError(