Don't muffle errors in lack.middleware.backtrace by default.

This commit is contained in:
Eitaro Fukamachi 2015-03-13 11:17:06 +09:00
parent 0937577b5c
commit befd96f5ed

View file

@ -8,9 +8,9 @@
(defvar *lack-middleware-backtrace*
(lambda (app &key
(output '*error-output*)
(result-on-error '(500 (:content-type "text/plain") ("Internal Server Error"))))
result-on-error)
(check-type output (or symbol stream pathname string))
(check-type result-on-error (or function cons))
(check-type result-on-error (or function cons null))
(flet ((error-handler (condition)
(if (functionp result-on-error)
(funcall result-on-error condition)
@ -30,7 +30,8 @@
(block nil
(handler-bind ((error (lambda (condition)
(output-backtrace condition env)
(return (error-handler condition)))))
(when result-on-error
(return (error-handler condition))))))
(funcall app env)))))))
(defun print-error (error env &optional (stream *error-output*))