A conditional exception handler is an on e: … do block in an exception handler that has a where condition. This allows you to only catch an exception when all your conditions apply to it. Although we’ve had this feature since the first version of Chrome, it’s not a very well known.
Above block reads data from a socket, but it catches the “Reset by peer” exception, and returns 0, like it’s a regular disconnect.
Subscribe to RemObjects Software Blog
Get the latest posts delivered right to your inbox