aboutsummaryrefslogtreecommitdiff
path: root/lazybones.lisp
diff options
context:
space:
mode:
Diffstat (limited to 'lazybones.lisp')
-rw-r--r--lazybones.lisp29
1 files changed, 7 insertions, 22 deletions
diff --git a/lazybones.lisp b/lazybones.lisp
index 0ac07ba..3cf3bad 100644
--- a/lazybones.lisp
+++ b/lazybones.lisp
@@ -64,10 +64,6 @@
:accessor app-state-table
:initform (make-hash-table)
:documentation "A hash table with EQL comparing keys. Used for storing arbitrary application state.")
- (app-error-response-contents
- :accessor app-error-response-contents
- :initform nil
- :documentation "an alist of (CODE CONTENT)")
(default-content-type
:accessor default-content-type
:initarg :content-type
@@ -83,26 +79,15 @@
(defun (setf app-state) (value key &optional (app *app*))
(setf (gethash key (app-state-table app)) value))
-(defun error-content (code &optional (app *app*))
- (cdr (assoc code (app-error-response-contents app))))
-
-(defun (setf error-content) (value code &optional (app *app*))
- (a:if-let (found (assoc code (app-error-response-contents app)))
- (setf (cdr found) value)
- (push (cons code value) (app-error-response-contents app))))
(defun expand-provision-app-option (app option value)
(list 'setf
- (etypecase option
- (keyword
- (ecase option
- ((:desc :description) `(lazybones::app-description ,app))
- (:title `(lazybones::app-title ,app))
- (:version `(lazybones::app-version ,app))
- (:content-type `(lazybones::default-content-type ,app))
- ((:auth :authorizer) `(lazybones::request-authorizer ,app))))
- (integer
- `(lazybones::error-content ,option ,app)))
+ (ecase option
+ ((:desc :description) `(lazybones::app-description ,app))
+ (:title `(lazybones::app-title ,app))
+ (:version `(lazybones::app-version ,app))
+ (:content-type `(lazybones::default-content-type ,app))
+ ((:auth :authorizer) `(lazybones::request-authorizer ,app)))
value))
(defmacro provision-app ((&optional name) &body body)
@@ -401,6 +386,6 @@ file. CONTENT-TYPE should be a MIME type string."
"*APP*, *RESPONSE* and *REQUEST* should all be defined here."
(http-respond
code
- (or content (error-content code))))
+ content))