improve project server 404 error message

pull/218/head
Matthew Butterick 5 years ago
parent bb1e3d8df0
commit 12ba29dc03

@ -307,9 +307,15 @@
;; 404 route
(define/contract (route-404 req)
(request? . -> . response?)
(define missing-url (url->string (request-uri req)))
(define missing-path-string (path->string (simplify-path (req->path req))))
(message (format "can't find ~a" missing-path-string))
(message (format "can't find ~a" missing-url))
(response/xexpr+doctype
`(html
(head (title "404 error") (link ((href "/error.css") (rel "stylesheet"))))
(body (div ((class "section")) (div ((class "title")) "404 error") (p ,(format "~v" missing-path-string) " was not found"))))))
(body (div ((class "section"))
(div ((class "title")) "404 error")
(p ,(format "URL ~v was not found at path ~v" missing-url
(match missing-path-string
[(regexp #rx"/$") (string-append missing-path-string "index.html")]
[mps mps]))))))))

@ -1 +1 @@
1570719309
1572061641

Loading…
Cancel
Save