On Mon, 27 Feb 2006 12:07:52 -0500, "Chad Whitacre" <[EMAIL PROTECTED]> said: > From conversations this weekend (briefly with Jim; also with Guido) it > seems that the most controversial aspect of httpy's API is the use of > raise for flow control. I wonder if you all wouldn't mind helping me get > to the bottom of this issue?
I agree with the general sentiment that raise/except to pass Response objects around feels clunky. > I think the trick is that in HTTP, success and error conditions both > produce the same result: a Response message. In Python we distinguish > the two: successful "requests" (i.e., function calls) return something; > bad requests raise something. If the source of your unease is the handler returning both "success" and "error" responses itself, I'm more comfortable with the abstraction of a handler raising some NotFoundError, for instance, and translating that into a 404 response farther up the stack. (Spyce takes this approach because centralizing exception handling like this makes it easy to allow the user to plug in a custom function to handle them if necessary.) -Jonathan -- C++ is history repeated as tragedy. Java is history repeated as farce. --Scott McKay _______________________________________________ Web-SIG mailing list Web-SIG@python.org Web SIG: http://www.python.org/sigs/web-sig Unsubscribe: http://mail.python.org/mailman/options/web-sig/archive%40mail-archive.com