It now has a special variable *HTTP-ERROR-HANDLER*
(defaults to NIL
) which can hold a function designator to an error handler for HTTP errors like the 404 Not Found error.
NIL
and TBNL takes over. The function could emit some explanation about the site's structure or just show the wrong part of the URL and make fun of the visitor. :-)(defun http-error-handler (code)
"Return content for error output of HTTP error CODE."
(case code
(404 (emb:execute-emb *fnf-error-template*
`(:code 404 :uri ,(tbnl:request-uri))))))
(setf tbnl:*http-error-handler* 'http-error-handler)