mirror of
https://github.com/vale981/lack
synced 2025-03-06 01:41:39 -05:00
Don't muffle errors in lack.middleware.backtrace by default.
This commit is contained in:
parent
0937577b5c
commit
befd96f5ed
1 changed files with 4 additions and 3 deletions
|
@ -8,9 +8,9 @@
|
||||||
(defvar *lack-middleware-backtrace*
|
(defvar *lack-middleware-backtrace*
|
||||||
(lambda (app &key
|
(lambda (app &key
|
||||||
(output '*error-output*)
|
(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 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)
|
(flet ((error-handler (condition)
|
||||||
(if (functionp result-on-error)
|
(if (functionp result-on-error)
|
||||||
(funcall result-on-error condition)
|
(funcall result-on-error condition)
|
||||||
|
@ -30,7 +30,8 @@
|
||||||
(block nil
|
(block nil
|
||||||
(handler-bind ((error (lambda (condition)
|
(handler-bind ((error (lambda (condition)
|
||||||
(output-backtrace condition env)
|
(output-backtrace condition env)
|
||||||
(return (error-handler condition)))))
|
(when result-on-error
|
||||||
|
(return (error-handler condition))))))
|
||||||
(funcall app env)))))))
|
(funcall app env)))))))
|
||||||
|
|
||||||
(defun print-error (error env &optional (stream *error-output*))
|
(defun print-error (error env &optional (stream *error-output*))
|
||||||
|
|
Loading…
Add table
Reference in a new issue