diff options
-rw-r--r-- | mumi/web/controller.scm | 42 |
1 files changed, 16 insertions, 26 deletions
diff --git a/mumi/web/controller.scm b/mumi/web/controller.scm index 11ad714..e420311 100644 --- a/mumi/web/controller.scm +++ b/mumi/web/controller.scm @@ -38,19 +38,6 @@ target (list functions ...))) -(define (render-with-error-handling page message) - (apply render-html (page)) - ;; (catch #t - ;; (lambda () - ;; (receive (sxml headers) - ;; (pretty-print (page)) - ;; (render-html sxml headers))) - ;; (lambda (key . args) - ;; (format #t "ERROR: ~a ~a\n" - ;; key args) - ;; (render-html (error-page message)))) - ) - (define %session-manager (let ((key-file (string-append (%config 'key-dir) "signing-key"))) (if (file-exists? key-file) @@ -87,21 +74,24 @@ ;; Search for matching messages and return list of bug reports ;; that belong to them. (else - (render-with-error-handling - (lambda () - (list-of-matching-bugs query - (match (process-query query) - ((#:terms terms - #:sets s) - (search-bugs (string-join terms) - #:sets s))))) - `(p "Could not search for " (strong ,query) ".")))))) + (apply render-html + (list-of-matching-bugs query + (match (process-query query) + ((#:terms terms + #:sets s) + (search-bugs (string-join terms) + #:sets s))))))))) ((or ('GET "issue" (? string->number id)) ('GET (? string->number id))) - (render-with-error-handling - (lambda () (or (and=> (fetch-bug id) issue-page) - (unknown id))) - `(p "Could not access issue #" (strong ,id) "."))) + (let ((message (match (uri-query (request-uri request)) + ("comment-ok" + '(info . "Your comment has been submitted!")) + ("comment-error" + '(error . "There was an error submitting your comment!")) + (_ #f)))) + (apply render-html (or (and=> (fetch-bug id) + issue-page) + (unknown id))))) (('GET "issue" (? string->number id) "attachment" (? string->number msg-num) (? string->number path) ...) |