Add trivial-backtrace
This commit is contained in:
parent
47bc8cc9ee
commit
4949324e05
4 changed files with 14 additions and 3 deletions
1
qlfile
1
qlfile
|
@ -6,3 +6,4 @@ git ningle-fbr https://github.com/skyizwhite/ningle-fbr.git
|
|||
ql cl-ppcre
|
||||
ql log4cl
|
||||
ql function-cache
|
||||
ql trivial-backtrace
|
||||
|
|
|
@ -34,3 +34,7 @@
|
|||
(:class qlot/source/ql:source-ql
|
||||
:initargs (:%version :latest)
|
||||
:version "ql-2023-10-21"))
|
||||
("trivial-backtrace" .
|
||||
(:class qlot/source/ql:source-ql
|
||||
:initargs (:%version :latest)
|
||||
:version "ql-2023-10-21"))
|
||||
|
|
|
@ -1,8 +1,7 @@
|
|||
(defpackage #:hp/config
|
||||
(:use #:cl)
|
||||
(:import-from #:log4cl)
|
||||
(:export #:*env*
|
||||
#:dev-mode-p
|
||||
(:export #:dev-mode-p
|
||||
#:prod-mode-p))
|
||||
(in-package #:hp/config)
|
||||
|
||||
|
|
|
@ -1,9 +1,16 @@
|
|||
(defpackage #:hp/middlewares/recovery
|
||||
(:use #:cl)
|
||||
(:import-from #:log4cl)
|
||||
(:local-nicknames (#:tb #:trivial-backtrace))
|
||||
(:local-nicknames (#:cfg #:hp/config))
|
||||
(:export #:*recovery*))
|
||||
(in-package #:hp/middlewares/recovery)
|
||||
|
||||
(defun message (condition)
|
||||
(if (cfg:dev-mode-p)
|
||||
(tb:print-backtrace condition :output nil)
|
||||
"Internal Server Error"))
|
||||
|
||||
(defparameter *recovery*
|
||||
(lambda (app)
|
||||
(lambda (env)
|
||||
|
@ -12,4 +19,4 @@
|
|||
(error (c)
|
||||
(log:error "Unhandled error caught: ~a" c)
|
||||
`(500 (:content-type "text/plain")
|
||||
("Internal Server Error")))))))
|
||||
(,(message c))))))))
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue