[Aldor-l] Exceptions in aldor
Ralf Hemmecke
ralf at hemmecke.de
Fri Mar 31 05:02:57 EST 2006
On 03/31/2006 07:37 AM, Christian Aistleitner wrote:
> Hello,
>
>> Since you have Aldor, you have the libaldor sources. You simply grep
>> for "Exception" and you find the following:
>
> if every exception contains "Exception" in its name, this approach
> should be fair enough.
> However, this need not be the case.
> There is for example the exception RuntimeError :)
> RuntimeError is actually thrown, so I consider it an exception.
> It is however of type RuntimeException (sadly enough a category of the
> aldor library NOT ending in Type), so even the grepping for Exception
> would give some hint to it.
Yes, Christian is right. But on the other hand RuntimeError only appears
in /src/util/rtexns.as and additionally, it doesn't look like it should
be called from Aldor code (though it could).
-- s is a C-string, which is not the same as a salli debug String
RuntimeError(s: Pointer): RuntimeException == add {
name(): String == string s;
printError(o: TextWriter): () == { import from String; o << name(); }
}
One cannot simply say
throw RuntimeError("Message");
but has to say more unnaturally...
throw RuntimeError pointer "Message";
I don't think that RuntimeError should be used.
Anyway, there is some work to be done to somehow bring some order in all
the exception stuff. For example there is no common ExceptionType that
all other exceptions inherit from.
Ralf
More information about the Aldor-l
mailing list