Matt Welland <[email protected]> writes:

> I'd like to handle the case where http-client gets denied a
> connection. I wrapped the call to with-input-from-request with a
> handle-exceptions but that doesn't catch the error.

How do you try to catch it?

The following seems to work for me in csi:

#;1> (thread-start!
 (make-thread
   (lambda ()
     (with-exception-handler (lambda (e) (print e))
                             (lambda ()
                               (with-input-from-request
                                  "http://localhost";
                                   #f read-lines))))))

#<thread: thread227>
#;2> #<condition: (exn http server-error)>

The warning is an indication that the exception does not get caught in a
thread handler but the primordeal thread, see also the notes in
http://api.call-cc.org/doc/srfi-18#sec:Notes

Kind regards,

Christian


_______________________________________________
Chicken-users mailing list
[email protected]
https://lists.nongnu.org/mailman/listinfo/chicken-users

Reply via email to