On Mon, 2011-05-16 at 02:27 -0400, Chris McDonough wrote:
> I've created a branch named "httpexception-utils" on GitHub which
> contains an implementation of "redirect" and "abort" for Pyramid that
> act like their Pylons brethren.

Thanks a lot for everybody's input on this.

There was pushback on both the abort() and redirect() APIs and on the
registration of new default exception views.

Steve Lacy: there is no equivalence between "return abort(401)" and
"return HTTPNotFound()".  Instead there is an equivalence between
"abort(401)" and "raise HTTPNotFound()".  Pyramid already has a feature
which allows a developer to convert exceptions to responses
( 
http://docs.pylonsproject.org/projects/pyramid/1.0/narr/views.html#exception-views
 ), the "abort()" and "redirect()" spellings would just be Pylons-esque candy 
on top of this.  It sounds like you're objecting to both the exception view 
feature and to the candy and you'd prefer to always just return a response, I 
think.

Tres: Given that we already have exception view machinery (the magic you
refer to already exists), I don't think there would be much purpose in
adding a decorator that converts an exception to a response instead of
just registering exception views.

Mike M.: The fact that abort(404) (or raise HTTPNotFound) would not
invoke the not found view is a genuine concern.  This is the primary
reason I haven't just gone ahead and merged the branch.  I'm not really
sure how to make this happen in a way that I'm confident doesn't paint
us into a corner in the future, though.

Bleh.  Not really sure what to do.

- C




-- 
You received this message because you are subscribed to the Google Groups 
"pylons-devel" group.
To post to this group, send email to pylons-devel@googlegroups.com.
To unsubscribe from this group, send email to 
pylons-devel+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/pylons-devel?hl=en.

Reply via email to