aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/protocol.lisp11
1 files changed, 4 insertions, 7 deletions
diff --git a/src/protocol.lisp b/src/protocol.lisp
index 300195f..51c7211 100644
--- a/src/protocol.lisp
+++ b/src/protocol.lisp
@@ -26,6 +26,8 @@
:type (or nil (integer 100 599))))
(:documentation "Conditions signalled during the request handling protocol."))
+(defmethod status-code ((err error)) 500)
+
(define-condition cannot-authenticate (protocol-error) ()
(:default-initargs :status-code 401)
(:documentation "Signalled when a endpoint's AUTHENTICATE method returns NIL,
@@ -58,7 +60,7 @@ that the request has insufficient permissions to evoke the endpoint handler. "))
(defgeneric protocol-error-result (err)
(:documentation "The content and mimetype to returned to the client having encountered
an error.")
- (:method ((err protocol-error)) (values nil nil)))
+ (:method ((err error)) (values nil nil)))
(defun abort-on-error (err)
"Assign a return code based on the type of error encountered and
@@ -78,15 +80,10 @@ that the request has insufficient permissions to evoke the endpoint handler. "))
(defmethod http:acceptor-dispatch-request :around ((acceptor http:acceptor) request)
(handler-case (call-next-method)
- (protocol-error (err)
- (if *debugging*
- (invoke-debugger err)
- (abort-on-error err)))
-
(error (err)
(if *debugging*
(invoke-debugger err)
- (http:abort-request-handler)))))
+ (abort-on-error err)))))
(defun protocol-error (error-class ep &rest kwargs)
(apply #'error