Login | Register For Free | Help
Search for: (Advanced)

Mailing List Archive: ModPerl: ASP

exception handling under Apache::ASP

 

 

ModPerl asp RSS feed   Index | Next | Previous | View Threaded


pbeardsley at appropriatesolutions

Nov 24, 2004, 6:38 AM

Post #1 of 2 (1466 views)
Permalink
exception handling under Apache::ASP

Hi,
This might be a more general mod_perl question, and if so let me know,
but I'm trying to add exception handling to my Apache::ASP code.
Basically I have a module that encapsulates all my data access, with all
the UI logic handled in ASP pages. What I want to do is throw
exceptions in the data module, and catch them in the ASP pages. I've
been using Error::Simple and throwing errors in the data module like so:

throw Error::Simple( 'My Error');

the calling code in the ASP page looks like so:

try {
Data::DataRoutine();
}
catch Error::Simple with {
my $E;
$Response->Write($E);
}

But the throw always triggers an Apache error and gets written to the
Apache log. I've also tried the module Exception::Class with similar
results.

Can anybody with experience doing exception handling under Apache::ASP
tell me what works for them and point me in the right direction?

Thanks,
-Peter.

---------------------------------------------------------------------
To unsubscribe, e-mail: asp-unsubscribe [at] perl
For additional commands, e-mail: asp-help [at] perl


josh at chamas

Dec 5, 2004, 11:00 PM

Post #2 of 2 (1342 views)
Permalink
Re: exception handling under Apache::ASP [In reply to]

Peter Beardsley wrote:
> Hi,
> This might be a more general mod_perl question, and if so let me know,
> but I'm trying to add exception handling to my Apache::ASP code.
> Basically I have a module that encapsulates all my data access, with all
> the UI logic handled in ASP pages. What I want to do is throw
> exceptions in the data module, and catch them in the ASP pages. I've
> been using Error::Simple and throwing errors in the data module like so:
>
> throw Error::Simple( 'My Error');
>
> the calling code in the ASP page looks like so:
>
> try {
> Data::DataRoutine();
> }
> catch Error::Simple with {
> my $E;
> $Response->Write($E);
> }
>
> But the throw always triggers an Apache error and gets written to the
> Apache log. I've also tried the module Exception::Class with similar
> results.
>
> Can anybody with experience doing exception handling under Apache::ASP
> tell me what works for them and point me in the right direction?
>

Well, I'm pretty old fashioned in this regards, but I rely on die() for
my error throwing, and eval {} for my error catching, and just check
for whether $@ exists after the eval {} to see if there was an error.

BTW, sorry for not getting back for so long. I am been swamped with
work recently.

Regards,

Josh

---------------------------------------------------------------------
To unsubscribe, e-mail: asp-unsubscribe [at] perl
For additional commands, e-mail: asp-help [at] perl

ModPerl asp RSS feed   Index | Next | Previous | View Threaded
 
 


Interested in having your list archived? Contact Gossamer Threads
 
  Web Applications & Managed Hosting Powered by Gossamer Threads Inc.