--- Andrew Nikitin <[EMAIL PROTECTED]> wrote:
> >Date: Thu, 06 Sep 2007 10:40:18 -0700
> >From: Roger Hui <[EMAIL PROTECTED]>
> >
> >An uncaught throw does not terminate execution.
> >Instead, it causes return to immediate execution
> >and is the specified behaviour.
> >
> >http://www.jsoftware.com/help/dictionary/cthrow.htm
>
> Yes, I know. That is what I am complaining about.
> I was debugging some code and had to manually call a verb that calls a verb
> that had throw. inside. Normally it was caught in gui and gave indication of
> it, but during debugging no gui was active. When some piece of data began
> causing throw. it was not at all immediately obvious what the hell is going
> on. Is it some quirk of a debugger? of a J? Legitimate i.0 0 result from the
> cover verb?
>
> The point is: some indication of what just happened would be nice.
If you take code at the above page and place
breakpoint in the "sub" function and trace from
there, the debugger perfectly places the code pointer
inside catcht. block.
In general, throw. must only be used with catcht. in outside
function for very specific scenarios,
i.e. should NOT be used at all.
Instead, a regular catch. should be used with a signal
that produces a custom user error. This way you have
uniformity of handling system, user, and explicitly raised
exceptions in one way. This was adopted in JHP and other
addons where reliable error handling plays a critical role.
____________________________________________________________________________________
Yahoo! oneSearch: Finally, mobile search
that gives answers, not web links.
http://mobile.yahoo.com/mobileweb/onesearch?refer=1ONXIC
----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm