Installing a condition handler in Common Lisp
- by Paul Nathan
The HTTP library Drakma on CLISP generates an error USOCKET:UNSUPPORTED due to a bug in Drakma+CLISP. However, it turns out that the CONTINUE restart seems to work fine. Therefore, I spent some time with CLtL and other references trying to determine how to write a restart handler.
(defun http-request (url param)
(handler-bind ((USOCKET:UNSUPPORTED
#'(lambda (x)
(invoke-restart 'continue)))))
(drakma:http-request url
:method :post
:parameters
param))
According to my best understanding, the above code should trap the error USOCKET:UNSUPPORTED. It doesn't; it seems to ignore the error binder.
How do I fix this?