[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
handling multiple exceptions
- To: address@hidden
- Subject: handling multiple exceptions
- From: address@hidden (Scott Jaderholm)
- Date: Mon, 4 Feb 2002 00:30:01 -0500 (EST)
- Organization: http://groups.google.com/
- Xref: traf.lcs.mit.edu comp.lang.dylan:13959
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