Paste number 81046: debuggable-acceptor

Paste number 81046: debuggable-acceptor
Pasted by: younder
When:1 year, 3 months ago
Share:Tweet this! | http://paste.lisp.org/+1QJA
Channel:None
Paste contents:
Raw Source | XML | Display As
;;; Courtesy of Andreas Fucks
;;; An acceptor that invokes the debugger on errors:

(defclass debuggable-acceptor (hunchentoot:acceptor)
     ())

(defmethod process-connection ((*acceptor* debuggable-acceptor) (socket t))
  (declare (ignore socket))
  (handler-bind ((error #'invoke-debugger))
    (call-next-method)))

(defmethod acceptor-request-dispatcher ((*acceptor* debuggable-acceptor))
  (let ((dispatcher (call-next-method)))
    (lambda (request)
      (handler-bind ((error #'invoke-debugger))
        (funcall dispatcher request)))))

This paste has no annotations.

Colorize as:
Show Line Numbers

Lisppaste pastes can be made by anyone at any time. Imagine a fearsomely comprehensive disclaimer of liability. Now fear, comprehensively.