[tbnl-devel] Handling HTTP errors

Stefan Scholl stesch at no-spoon.de
Sat Jul 31 00:10:11 UTC 2004


Hi!

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?


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.)




Regards,
Stefan






More information about the Tbnl-devel mailing list