Bay.Chang at Eng.Sun.COM
Tue Feb 16 20:54:30 UTC 1993
> When an error occurs in objects, introduced by myself, the name of the
> method-holder is something like <a child of ..> instead of <odeOrd5>.
> So the question is: how can I make Self to print the name of my objects
> instead of printing <child of..>?
The error printing code intentionally avoids sending printString (or
any other message) to the objects involved in the error. So even if
theObjectPrints, it will print out in the error message as "child of
traits foo"--this was done intentionally so that error messages and
stack dumps wouldn't break if the foo printing code was broken.
So to answer the question: there is nothing you can do to your object
to make it print more intelligently in the error message. One thing
you could do is alter the error message printing code to do what you
want (send printString to the object if theObjectPrints), but that
would make errors less safe (consecutive stack dumps are very
(It would be more robust if there were a way to print the printString
if it can, and go for the backup <a child of ...> only when printing
fails. An exception-handling mechanism could provide this, for
More information about the Self-interest