is this a bug or feature?

25 views
Skip to first unread message

Chengliang Yan

unread,
Jul 1, 2012, 6:28:18 AM7/1/12
to we...@googlegroups.com
Hi,recently i construct an app using webpy,everthing works well,it is great.but when i want to catch my app base-exception in my processor,it failed. 
when i view the webpy source code,i see the followwing lines:

    def handle_with_processors(self):
        def process(processors):
            try:
                if processors:
                    p, processors = processors[0], processors[1:]
                    return p(lambda: process(processors))
                else:
                    return self.handle()
            except web.HTTPError:
                raise
            except (KeyboardInterrupt, SystemExit):
                raise
            except:
                print >> web.debug, traceback.format_exc()
                raise self.internalerror()

it means if no exception raises,my processor can process on and on,else raise the internalerror exception and my processor loses it.
of course,i can catch the exception in my GET/POST method using decorator or other ways.but it is not that good.
So what i want is the "handle_with_processors" does not catch any exception before the processors,just catch those exceptions after the processors.
I do not know if this is reasonable,so i post the title like this.hope somebody can help me out of that.thanks:)

Reply all
Reply to author
Forward
0 new messages