[Web-SIG] Exceptions (was: Form field dictionaries)

Ian Bicking ianb at colorstudy.com
Fri Oct 24 13:39:02 EDT 2003

On Friday, October 24, 2003, at 12:27 PM, Steve Holden wrote:
> I've argued in the past that the correct approach is to determine in
> advance which fields can take multiple values, and reject multiple
> values for other fields as an error early in the form processing.

This brings up error handling.  If you encounter a bad request (e.g., 
mutliple fields where it's not expected), what do you do?  An internal 
exception isn't good, because it's not really an internal error -- you 
get Internal Server Error, log messages imply your code is broken, etc.

It would be nice instead to be able to throw an exception that would be 
translated into the proper response (in the CGI environment this could 
use a process like cgitb, in other environments the hook is a bit 
easier to put in).

Of course, once you have a bad request exception, redirect, forbidden, 
authentication required, and other responses all make sense as 
exceptions too...

Ian Bicking | ianb at colorstudy.com | http://blog.ianbicking.org

More information about the Web-SIG mailing list