i have some code that looks like this:
class controller:
def index(self):
"""dispatcher""
try:
dbsetup()
authorize_this_task()
if action == 'a':
self.other_action()
...etc...
except:
error()
def other_action(self):
try:
do_another_thing()
dbcommit()
except:
handle_error()
raise
redirect(success_url)
the issue is that redirect() raises a "webob.exc" error, which means
my code get really really messy trying to catch it.
right now some methods that are dispatched to redirect, others return
a render
a lot of this was coded before i realized how redirect worked. i would
have done things differently had i realized this all.
anyone have a suggestion on how i can handle this better?
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"pylons-discuss" 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/pylons-discuss?hl=en
-~----------~----~----~----~------~----~------~--~---