> > Another point concerning me -
> >
> > The pattern I think to use is someting like this:
> >
> >     @expose(template="tm.templates.form")
> >     def edit_person(self, tg_errors=None, tg_exceptions=None):
> >         if tg_errors:
> >             flash("Problem validating! Please correct")
> >         if tg_exceptions:
> >             flash("Problem saving! Please correct")
> >         .
> >         .
> >         .
> >
> >
> >     @expose()
> >     @turbogears.validate(form=person_form)
> >     @turbogears.error_handler(edit_person)
> >     @turbogears.exception_handler(edit_person)
> >     def save(self, name):
> >             u = User(name=name)
> >             u.flush()
> >
> > I guess this is the most easy way to handle errors and exceptions
> > while
> > data entry by user. Need guidence on the way to achieve this pattern
> > with the patch.
>
> Actually, the above code should work as-is ;)

But, it is not working, and gives "500 internal error" page! From here
only my story started, and then as a diagnosis I explored to use raw
exception handling (for which your patch works fine).

> Just a note, if you
> only want to branch to "edit_person" in case a SQLError exception is
> raised by SA you can specialize exception_handler with a dispatch rule:

Thanks. Would be quite useful, but only after we make the above code
work.

Thanks
Sanjay


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"TurboGears" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at http://groups.google.com/group/turbogears
-~----------~----~----~----~------~----~------~--~---

Reply via email to