On Fri, Feb 6, 2009 at 11:01 AM, Nick Retallack <[email protected]> wrote:
>
> I think it's pretty awesome that web.py models http errors as
> exceptions. However, I don't want my application logic to depend on
> web.py -- sometimes I want to run it in isolation, or offline, so it
> doesn't make sense to import web.notfound everywhere. I'd rather
> throw my own notfound exception, and have web.py catch it and realize
> what it is supposed to be. Know what I mean? Any ideas?
You can do this, if it pleases you.
class MyNotFound(web.NotFound):
pass
class foo:
def GET(self):
raise MyNotFound()
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"web.py" 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/webpy?hl=en
-~----------~----~----~----~------~----~------~--~---