On Sat, 31 Jul 2004 02:10:11 +0200, Stefan Scholl stesch@no-spoon.de wrote:
Function send-output in modlisp.lisp handles the response for different return codes. E. g. there's a "The requested URL ~A was not found on this server." for the 404 (+http-not-found+).
How about letting the user change this behavior?
One could explain the error to the user. Maybe in another language.
Or think of all the funny 404 games. Remember the SGI babies?
Like so? http://weitz.de/not-there
:)
There could be different approaches:
Simple hash A hash with error code as key and handler as value.
- Easy to implement
- Can handle all errors (thrown by handlers _and_ when no dispatcher is found)
- Not very flexible. Just checks for the code and not for any request data.
Error dispatcher Like the normal dispatcher, but checking for the right error output handler.
- Can handle all errors (thrown by handlers _and_ when no dispatcher is found)
- Flexible. Can check the code _and_ request data.
- A bit big. The same effort like handling normal requests.
Handler outputs itself and signals that A handler wants to return a 404. It constructs the output string and signals the fact that there's no need for TBNL to build the HTML for the output.
- Easy to implement(? clean?)
- Flexible
- Can't handle all errors. (No handler found? Then the code won't be executed.)
I agree that this would generally be a good idea. I'm not sure yet which of the above-mentioned alternatives I like most or if there's another one that would even be better.
Cheers, Edi.