Try an eval{} block around your $app->run call, then process your error
based on that.

<CODE>
eval {
        $appl->run();
} or do {
        my($error) = $@;
        print $appl->query->header(-status=>'400 Bad Request'),
              $appl->Exception($error);
}
</CODE>

Perhaps an alternative...

<CODE>
eval {
      $appl->run();
}

if ($@) {
      $appl->Exception...
}
</CODE>

Brian
----
Brian T. Wightman
[EMAIL PROTECTED]
414.524.4025


|---------+---------------------------->
|         |           [EMAIL PROTECTED]|
|         |                            |
|         |           08/19/2003 05:41 |
|         |           AM               |
|         |                            |
|---------+---------------------------->
  
>--------------------------------------------------------------------------------------------------------------------------------------------------|
  |                                                                                    
                                                              |
  |       To:       [EMAIL PROTECTED]                                                  
                                                       |
  |       cc:                                                                          
                                                              |
  |       Subject:  [cgiapp] Fatal exceptions before entering runmode                  
                                                              |
  
>--------------------------------------------------------------------------------------------------------------------------------------------------|




Hello,

I'd like to be able to return fatal exceptions to the browser for fatal
errors occurring before entering a runmode method for my app - eg from
cgiapp_init, cgiapp_prerrun, etc..  Is this possible?  In particular, I'd
like to use exceptions as provided by Error.pm and return output generated
by my exception using HTML::Template.

I think this means that I need to 1) trap any die signals and 2) get
control of the request socket from the CGI instance object, and then return

my output on that socket.  Any clues appreciated

Thanks.

Bill Catlan


---------------------------------------------------------------------
Web Archive:  http://www.mail-archive.com/[EMAIL PROTECTED]/
              http://marc.theaimsgroup.com/?l=cgiapp&r=1&w=2
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]






---------------------------------------------------------------------
Web Archive:  http://www.mail-archive.com/[EMAIL PROTECTED]/
              http://marc.theaimsgroup.com/?l=cgiapp&r=1&w=2
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to