Installing a condition handler in Common Lisp

Posted by Paul Nathan on Stack Overflow See other posts from Stack Overflow or by Paul Nathan
Published on 2010-12-30T00:40:08Z Indexed on 2010/12/30 1:54 UTC
Read the original article Hit count: 278

Filed under:
|
|
|

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?

© Stack Overflow or respective owner

Related posts about exception

Related posts about lisp