[racket] Catching Com exception

From: Matthew Flatt (mflatt at cs.utah.edu)
Date: Wed Feb 20 08:57:52 EST 2013

At Tue, 19 Feb 2013 13:36:17 +0100, heraklea at gmx.de wrote:
> is this the right direction?
> (with-handlers ([exn:fail? (lambda (exn) (printf "com-exp-file-exists"))])
>           (set! Object      (com-invoke COMOBJ "Method1"  2)))

Assuming that you want to catch exceptions that are raised by "Method1"
itself, as opposed to raised by the process of trying to find and call
"Method1", then I don't think this will work.

My limited experience with COM is that a method raises an "exception"
by either returning an error value or sending an event (which you'd
detect with `com-register-event-callback').

Posted on the users mailing list.