On 2007.10.16, Lemuel Formacil <[EMAIL PROTECTED]> wrote:
> Is there a way to completely abort the execution of an ADP page if an error
> occurred?  For example, if I have a page that runs something like this:
> 
> <%
> error "an error occurred here"
> ns_adp_puts "this won't show up"
> %>
> <p>some html</p>
> <%
> ns_adp_puts "this will show up"
> %>
> 
> and then I navigate to this page, the "<p>some html</p>" and the text "this
> will show up" will still be returned as an output.  It seems that only the
> block where the error occurred gets aborted.  Is this the correct behavior?
> Am I doing my ADP files (or configuration) completely wrong?

This is the correct behavior.  The idea is that a page should
"gracefully degrade" if an individual script block fails to successfully
complete (i.e., delivering a partial page is better than an error page
to a real user).

This is desirable in production systems where page construction has
external system dependencies (i.e., database queries, other RPC
mechanisms) and if those dependencies become unresponsive or
unavailable, you still want to be able to deliver a page to the client,
but gracefully degrade--the portion of the page that depends on that
unavailable system simply doesn't get rendered/delivered.

> I'm using AOLserver/4.0.10 distribution from macports.

If you can try AOLserver 4.5, the "singlescript" config parameter has
been introduced, which has the side-effect of giving you the behavior
you're expecting: any error on the page causes the entire page to result
in an error.

-- Dossy

-- 
Dossy Shiobara              | [EMAIL PROTECTED] | http://dossy.org/
Panoptic Computer Network   | http://panoptic.com/
  "He realized the fastest way to change is to laugh at your own
    folly -- then you can let go and quickly move on." (p. 70)


--
AOLserver - http://www.aolserver.com/

To Remove yourself from this list, simply send an email to <[EMAIL PROTECTED]> 
with the
body of "SIGNOFF AOLSERVER" in the email message. You can leave the Subject: 
field of your email blank.

Reply via email to