help-smalltalk
[Top][All Lists]
Advanced

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

[Help-smalltalk] Error handling/checking, exceptions in general


From: Bonzini
Subject: [Help-smalltalk] Error handling/checking, exceptions in general
Date: Sat, 21 Dec 2002 07:27:22 +0100

> how do I ascertain wheather a Socket has successfully connected to the
> other end?
>
> At first I figured #isPeerAlive would do it, but it doesn't.

It should be an error if the socket cannot be connected... though I don't
remember the exact semantics because connect does not block.  I'll let you
know, but after Christmas.

> And btw, in general. Suppose I came up with a few patches for improving
> the exception hierarchy and error handling in general, would it be of
> interest? I'm not saying I will because I can't promise that, but if I
> were.

Of course it depends on the patch :-) however I say it can be done as long
as it does not break ANSI compliancy.

> [ ... do some network i/o ... ]
> on: NetworkException
> do: [ ... ].

This is in my to-do list, though it is broken enough that I have not done it
yet.  It is as simple as "Error subclass: #NetworkException" and then
replacing "self error" with "NetworkException signal".

Only, you'll have to sign papers.  They'll arrive at your home if you
privately mail me your snail address.

> This requires a proper exception hierarchy and documentation of what
> exceptions may be thrown and in which circumstances.

At least at start use a single exception; then add more.  See
kernel/AnsiExcept.st for an example.

|_  _  _ __
|_)(_)| ),'
------- '---




reply via email to

[Prev in Thread] Current Thread [Next in Thread]