Loading ...
Sorry, an error occurred while loading the content.

Re: exception handling under Apache::ASP

Expand Messages
  • Josh Chamas
    ... 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 $@
    Message 1 of 2 , Dec 5, 2004
    • 0 Attachment
      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@...
      For additional commands, e-mail: asp-help@...
    Your message has been successfully submitted and would be delivered to recipients shortly.