TBNL 0.3.12 released
Edi Weitz released
TBNL 0.3.12 two days ago
(announcement).
It now has a special variable
hold a function designator to an error handler for HTTP
errors like the 404 Not Found error.
In the following example a simple error handler just handles the 404 error. Every other error
returns
emit some explanation about the site's structure or just show the wrong part of the URL and make fun of
the visitor. :-)
TBNL 0.3.12 two days ago
(announcement).
It now has a special variable
*HTTP-ERROR-HANDLER* (defaults to NIL) which canhold a function designator to an error handler for HTTP
errors like the 404 Not Found error.
In the following example a simple error handler just handles the 404 error. Every other error
returns
NIL and TBNL takes over. The function couldemit 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)
0 Comments:
Post a Comment
<< Home