[Zope3-dev] Formlib error handling
dev at projekt01.ch
dev at projekt01.ch
Thu May 18 16:12:50 EDT 2006
Hi Gary
[...]
> With your change, if the error is (or extends!) Invalid, it
> is hardcoded to assume the first argument is a string,
> message, or something with a reasonably __str__, translate if
> it is a message, and wrap the result with a <span>. I'd much
> prefer it if that code were ripped out of error_views and
> made, simply, into a view for (Invalid, IBrowserRequest),
> perhaps even registered by the formlib zcml. Do you see any
> issue with that?
No, that's a good idea. btw, I can also live without the
additional span tag arround the message string. Do you
have time to change this?
> Also, I don't love the 'widget_title' stuff in error_views: that
> seems to me to be the responsibility of the error view. Is that
> new? What's the rationale?
No, this was a existing part. I agree, we sould move this part to
the error view, if possible.
> > Log message for revision 67278:
> > Fix error handling, please double check this!
> >
> > The formlib.form.EditForm doesn't handle ValidationError in the
> > method error_views.
> > I converted ValidationError to WidgetInputError in the method
> > getWidgetsData which is responsible to catch errors raised by
> > the widget getInputValue method.
>
> This is the place in the code that knows the widget name and
> label, so it's not unreasonable.
What do you mean by this? Is it correct how I converted
ValidationError to useable widget input errors?
Regards
Roger Ineichen
> Thanks
>
> Gary
>
More information about the Zope3-dev
mailing list