show a bad-access file in the log

svn: r7411
This commit is contained in:
Eli Barzilay 2007-09-25 04:24:30 +00:00
parent c017ff26ae
commit 07d6df5ab4

View File

@ -167,14 +167,15 @@
[else #f])
(loop base (cdr elts)))))))
(define file (build-path server-dir tag))
(with-handlers ([exn:fail? (lambda (exn)
(log-line "Status exception: ~s" exn)
(make-page "Error" "Illegal file access"))])
(with-handlers ([exn:fail?
(lambda (exn)
(log-line "Status exception: ~a" (exn-message exn))
(make-page "Error" "Illegal file access"))])
;; Make sure the user is allowed to read the requested file:
(or (check file `(,who *) #t)
(check file `(#rx"^solution") #f)
(check file `(#rx"^solution" *) #f)
(error "Boom!"))
(error 'download "bad file access for ~s: ~a" who file))
(log-line "Status file-get: ~s ~a" who file)
(hook 'status-file-get `([username ,(string->symbol who)] [file ,file]))
;; Return the downloaded file