[plt-scheme] Error Messages in the PLT Scheme Web Server

From: Jay McCarthy (jay.mccarthy at gmail.com)
Date: Thu Jan 29 15:22:58 EST 2009

I've just committed what I hope is a very useful addition to the PLT Web Server.

Previously, if there was a problem with the syntax of the HTML code in
your servlet, you would get an opaque error, such as:

You broke the contract (-> request response) on start; expected
<response?>, given: (html (head ...
And you would have little clue what the problem with it was.

Now, the Web Server will reformat your response and annotate it will
all of its problems, then display that back to you.

A sample is available online: http://faculty.cs.byu.edu/~jay/tmp/plt-ws-errors/

Notice that all the errors are highlight in red and when you hover
over them, an explanation is given.

If you would to try at home, get the latest SVN and try out the
following servlet:

#lang web-server/insta
(define (start req)
  `(html (head (title "Hey"))
          ; Error 1
          ; Error 2
          ; Error 3
          ; Error 4
          (p . #f)
          ; Error 5
          (span ([href "#"] . #f) nbsp)
          ; Error 6
          (span ([href #f]) nbsp)
          ; Error 7
          (span ([#f "#"]) nbsp)
          ; Error 8
          (span ([href "#"] #f) nbsp))))

Jay McCarthy <jay at cs.byu.edu>
Assistant Professor / Brigham Young University

"The glory of God is Intelligence" - D&C 93

Posted on the users mailing list.