Hi all,

I do not want people to see "Contract violation: massive stack trace
documenting my brilliance as a programmer" every time they hit a bug on my
website.

Currently I show them simply an error page and redirect the trace to stderr
(see code below). But this doesn't track time of the error, and so on. Is
there a simple way to do this (seems like it should be a common problem),
or at least how to easily get the time-stamp from servlet-error-response
without having to manually pipe everything to stderr?

Cheers,

Marc

#lang racket

(require ...)

(define error-response
  (response/xexpr
    `(html
       ,(html-head "Error")
       (body
         (h1 "An error occurred")
         (p "We are sorry, but an error occurred.")
         (p "Please contact the person who is responsible for this mess to
fix it.")))))

(define (my-error-responder url exn)
  ((response-output (servlet-error-responder url exn)) (current-error-port))
  error-response)

(serve/servlet start
               #:log-file (build-path "local.logs")
               #:servlet-path "/"
               #:launch-browser? #f
               #:servlet-regexp #rx""
               #:extra-files-paths (list (build-path "htdocs"))
               #:servlet-responder my-error-responder
               )

-- 
You received this message because you are subscribed to the Google Groups 
"Racket Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to racket-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to