|
List Info
Thread: Abort ADP execution on error
|
|
| Abort ADP execution on error |

|
2007-10-16 07:36:44 |
|
Hello, everyone.
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?
I'm using AOLserver/4.0.10 distribution from macports.
Best,
Lemuel
--
AOLserver - http://www.aolserver.com/
To Remove yourself from this list, simply send an email to <listserv listserv.aol.com> with the
body of "SIGNOFF AOLSERVER" in the email message. You can leave the Subject: field of your email blank.
|
| Re: Abort ADP execution on error |

|
2007-10-16 08:48:31 |
|
- ns_adp_return
will return from the current adp file completely.
- return
will return from the current block of code in the file
- I'm not sure what the best method for "return what I've output so
far and do no more processing" is
Lemuel Formacil wrote:
mail.gmail.com"
type="cite">Hello, everyone.
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?
I'm using AOLserver/4.0.10 distribution from macports.
Best,
Lemuel
--
AOLserver - http://www.aolserver.com/
To Remove yourself from this list, simply send an email to listserv.aol.com"><listserv listserv.aol.com> with the
body of "SIGNOFF AOLSERVER" in the email message. You can leave the Subject: field of your email blank.
|
| Re: Abort ADP execution on error |

|
2007-10-16 09:07:50 |
On 2007.10.16, Lemuel Formacil <lemuelf GMAIL.COM> 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 | dossy panoptic.com | 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/
a>
To Remove yourself from this list, simply send an email to
<listserv listserv.aol.com> with the
body of "SIGNOFF AOLSERVER" in the email message.
You can leave the Subject: field of your email blank.
|
|
| Re: Abort ADP execution on error |

|
2007-10-17 01:39:37 |
|
On 10/16/07, Dossy Shiobara < dossy panoptic.com">dossy panoptic.com> wrote:
On 2007.10.16, Lemuel Formacil < lemuelf GMAIL.COM">lemuelf GMAIL.COM> 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. Thanks a lot, Dossy! That really explained the behavior.
That means I'm kinda doing my adp files wrong since I make multiple blocks of tcl code and I make later blocks of code _dependent_ on earlier blocks, so when something from the earlier blocks fail all succeeding dependent blocks also fail and I get a snowball of errors in my error_log. I'll try to avoid dependencies between tcl blocks in my adps.
> 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.
OK, I'll try that as well.
Thanks again!
Lemuel
--
AOLserver - http://www.aolserver.com/
To Remove yourself from this list, simply send an email to <listserv listserv.aol.com> with the
body of "SIGNOFF AOLSERVER" in the email message. You can leave the Subject: field of your email blank.
|
[1-4]
|
|
|
about | contact Other archives ( Real Estate discussion Medical topics )
|