[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

handling multiple exceptions



Hi, I have some code like this.

block()
  start-sockets();
  with-socket (client-socket, host: $ip,  port: $ip)
    format-out("%s\n", read-line(client-socket));
  end with-socket;        
  exception (condition :: <connection-failed>)
    format-out("%s\n", "connection failed.");
  end block;

The problem is that code can result in a number of exceptions, whether
it establshes a connection (and stop receiving data) or doesn't.  In
java you can have multiple catch blocks on a try block.  As I
understand it the block() is like a try block, so how do I have
multiple exception blocks?

Sincerely,
Scott