Chad Whitacre wrote:
> 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.
> 
> So perhaps the answer is that respond(request) may *either* 
> return *or* raise a Response?

This is the approach CherryPy takes. You can raise HTTPRedirect (for 3xx
responses) or HTTPError (for 4xx-5xx responses); however, 2xx responses
are usually performed with a normal "return". By far, the biggest issue
with this approach is educating users: not every *exception* is an
*error*.


Robert Brewer
System Architect
Amor Ministries
[EMAIL PROTECTED]
_______________________________________________
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

Reply via email to