I would just make my-error-responder print out date->string's result
on current-seconds. Is that now what you want?

On Thu, Mar 17, 2016 at 2:50 PM, Marc Kaufmann
<marc.kaufman...@gmail.com> wrote:
> 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.



-- 
Jay McCarthy
Associate Professor
PLT @ CS @ UMass Lowell
http://jeapostrophe.github.io

           "Wherefore, be not weary in well-doing,
      for ye are laying the foundation of a great work.
And out of small things proceedeth that which is great."
                          - D&C 64:33

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