[EMAIL PROTECTED] wrote:
assuming the error_handler decorator catches exceptions too
I really like this idea.

If we go with your approach I would still suggest using generic functions (yes, I like them very much ;)) to differentiate between errors. Otherwise I can see some error handlers consisting mostly of code checking what went wrong instead of doing something about it. I doubt this would help comprehensive.

If I may borrow your example:

@expose(html='etc')

# Something evil happend to our DB
@error_handler(sql_error, "isinstance(errors, SQLObjectIntegrityError)")

# Default
@error_handler(submit_error)

@input(form=form) # or @unpack as in #113
def submit(self, **data):
     ...



Simon

Reply via email to