[REBOL] Re: Better error messages?
From: sunandadh:aol at: 7-Dec-2001 5:37
[Al--Bri--xtra--co--nz] writes:
Hi Andrew
> > set in last LayoutData 'Text is used half a dozen times to change the text
> of a VID object, so a source scan isn't really close enough, even for
> government work.
>
> Change:
> set in last LayoutData 'Text
> into a function. Perhaps call it: 'Change-Text ?
I don't think that would help. it certainly wouldn't help in the case of an
error like:
** Throw Error: Return or exit not in function
** Near: Return true
(You can coax that one out of make-dir with suitably bad input. But it could
be an error in any one of dozens of mezzanines whose source I would not
recognise on sight.)
> > Most other languages you can pinpoint a failure to the line. Rebol just
> seems to give a hint.
> It's a bit hard for Rebol to do that because Rebol can be constructed and
> 'do-ne. For example, where is the line number in:
> do test
> ? 'test could be a block filled with all sorts of words that have been
> 'append-ed to, 'compose-d or 'reduce-d, or even entered from the keyboard!
>
Okay, maybe it can't be done in all cases. But what I'd like to see is some
way to access or print the calling stack at point of failure---so I can see
(for example) that we failed in Function init/display, which was called by
Function init/paint which was called by Function Startup. Rebol must have a
calling stack to be able to honour the 'return statements.
If Rebol won't do it for me, I'm looking to find out how to do it myself,
which I guess would involve wrapping the application in a Try block and then
sifting the damage info in the system object.
But there is no way I'd want to deploy into the field an application whose
error pinpointing as lackadaisical as Rebol's is today.
So any suggestions or pointers to the useful bits in the system object would
be greatly appreciated.
Thanks,
Sunanda.