aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorColin Okay <okay@toyful.space>2022-02-20 15:47:10 -0600
committerColin Okay <okay@toyful.space>2022-02-20 15:47:10 -0600
commit0437c4a85af5a4fbb68174d7c1266887acc692c1 (patch)
tree06283df51edadee8711f731acd84550cdd1085c4
parent65963eeef5afea104d5a94a99851e6eb79acd101 (diff)
ultra basic debugging on handler error
-rw-r--r--lazybones-hunchentoot.lisp5
-rw-r--r--lazybones.lisp2
-rw-r--r--package.lisp1
3 files changed, 7 insertions, 1 deletions
diff --git a/lazybones-hunchentoot.lisp b/lazybones-hunchentoot.lisp
index d752238..4e4ca15 100644
--- a/lazybones-hunchentoot.lisp
+++ b/lazybones-hunchentoot.lisp
@@ -55,7 +55,9 @@
(declare (ignorable e))
(let ((lzb:*request* request)
(lzb:*response* h:*reply*))
- (http-respond nil 500))))))
+ (if lzb:*debugging*
+ (invoke-debugger e)
+ (http-respond nil 500)))))))
;;; SERVER FUNCTIONS
@@ -173,6 +175,7 @@ HEADER-NAME can be a keyword or a string."
(defun request-body (&key (request lzb:*request*) (want-stream-p nil))
"Returns the decoded request body. The value returned depends upon
the value of the Content-Type request header."
+ (print "in request body")
(if %request-body-cache% %request-body-cache%
(setf %request-body-cache%
(when (member (request-method request) +hunchentoot-methods-with-body+)
diff --git a/lazybones.lisp b/lazybones.lisp
index 66192a2..de2aeba 100644
--- a/lazybones.lisp
+++ b/lazybones.lisp
@@ -18,6 +18,8 @@
"Dynamic variable holding the an APP instance. Dynamically bound by
RUN-ENDPOINT so that it is available if needed in request handlers.")
+(defvar *debugging* nil)
+
;;; HTTP-ERROR CONDITION
(define-condition http-error (condition)
diff --git a/package.lisp b/package.lisp
index 07c003d..c0506df 100644
--- a/package.lisp
+++ b/package.lisp
@@ -42,6 +42,7 @@
#:*app*
#:*request*
#:*response*
+ #:*debugging*
#:http-error
#:generate-app-documentation
#:provision-app