Improving servlet extent error message
svn: r859
This commit is contained in:
parent
8a35993125
commit
442286672b
|
@ -6,20 +6,13 @@
|
|||
(default-indices "index.html" "index.htm")
|
||||
(log-format parenthesized-default)
|
||||
(messages
|
||||
(servlet-message
|
||||
"servlet-error.html")
|
||||
(authentication-message
|
||||
"forbidden.html")
|
||||
(servlets-refreshed
|
||||
"servlet-refresh.html")
|
||||
(passwords-refreshed
|
||||
"passwords-refresh.html")
|
||||
(file-not-found-message
|
||||
"not-found.html")
|
||||
(protocol-message
|
||||
"protocol-error.html")
|
||||
(collect-garbage
|
||||
"collect-garbage.html"))
|
||||
(servlet-message "servlet-error.html")
|
||||
(authentication-message "forbidden.html")
|
||||
(servlets-refreshed "servlet-refresh.html")
|
||||
(passwords-refreshed "passwords-refresh.html")
|
||||
(file-not-found-message "not-found.html")
|
||||
(protocol-message "protocol-error.html")
|
||||
(collect-garbage "collect-garbage.html"))
|
||||
(timeouts
|
||||
(default-servlet-timeout 30)
|
||||
(password-connection-timeout 300)
|
||||
|
@ -28,14 +21,9 @@
|
|||
(file-base-connection-timeout 30))
|
||||
(paths
|
||||
(configuration-root "conf")
|
||||
(host-root
|
||||
"default-web-root")
|
||||
(log-file-path
|
||||
"log")
|
||||
(file-root
|
||||
"htdocs")
|
||||
(servlet-root
|
||||
".")
|
||||
(password-authentication
|
||||
"passwords"))))
|
||||
(host-root "default-web-root")
|
||||
(log-file-path "log")
|
||||
(file-root "htdocs")
|
||||
(servlet-root ".")
|
||||
(password-authentication "passwords"))))
|
||||
(virtual-host-table))
|
||||
|
|
|
@ -203,6 +203,8 @@
|
|||
(define (invoke-servlet-continuation conn req k-ref host-info)
|
||||
(let-values ([(uk-instance uk-id uk-salt) (apply values k-ref)])
|
||||
(let* ([uri (request-uri req)]
|
||||
[default-servlet-instance-expiration-handler
|
||||
(make-default-servlet-instance-expiration-handler host-info)]
|
||||
[default-servlet-continuation-expiration-handler
|
||||
(make-default-servlet-continuation-expiration-handler host-info)]
|
||||
[real-servlet-path (url-path->path
|
||||
|
@ -219,7 +221,13 @@
|
|||
(request-method req)))]
|
||||
[exn:servlet:continuation?
|
||||
(lambda (the-exn)
|
||||
((exn:servlet:continuation-expiration-handler the-exn) req))])
|
||||
((exn:servlet:continuation-expiration-handler the-exn) req))]
|
||||
[exn:servlet:no-current-instance?
|
||||
(lambda (the-exn)
|
||||
(output-response/method
|
||||
conn
|
||||
((default-servlet-instance-expiration-handler) req)
|
||||
(request-method req)))])
|
||||
(let* ([inst
|
||||
(hash-table-get config:instances uk-instance
|
||||
(lambda ()
|
||||
|
|
|
@ -4,7 +4,7 @@
|
|||
(lib "list.ss")
|
||||
"timer.ss")
|
||||
(provide (struct exn:servlet:instance ())
|
||||
(struct exn:servlet:current-instance ())
|
||||
(struct exn:servlet:no-current-instance ())
|
||||
(struct exn:servlet:continuation (expiration-handler))
|
||||
(struct servlet (handler namespace instance-expiration-handler))
|
||||
(struct execution-context (connection request suspend))
|
||||
|
@ -48,7 +48,7 @@
|
|||
;; not found in the continuatin table
|
||||
(define-struct (exn:servlet:continuation exn) (expiration-handler))
|
||||
;; not in dynamic extent of servlet
|
||||
(define-struct (exn:servlet:current-instance exn) ())
|
||||
(define-struct (exn:servlet:no-current-instance exn) ())
|
||||
|
||||
(define-values (make-k-table reset-k-table get-k-id!)
|
||||
(let ([id-slot 'next-k-id])
|
||||
|
|
|
@ -36,9 +36,7 @@
|
|||
(define (get-current-servlet-instance)
|
||||
(let ([inst (thread-cell-ref current-servlet-instance)])
|
||||
(unless inst
|
||||
(raise (make-exn:servlet:current-instance
|
||||
"(lib \"servlet.ss\" \"web-server\") used outside the dynamic-extent of a servlet-instance"
|
||||
(current-continuation-marks))))
|
||||
(raise (make-exn:servlet:no-current-instance "" (current-continuation-marks))))
|
||||
inst))
|
||||
|
||||
;; adjust-timeout! : sec -> void
|
||||
|
|
Loading…
Reference in New Issue
Block a user