On 2006-05-26, Timothy Appnel <[EMAIL PROTECTED]> wrote:
> I've been developing an application using the latest developer release
> of CGI::Application::Dispatch. Everything has gone great though I have
> hit one minor snag I've yet to figure out. I was hoping some one
> understood what I'm doing wrong here.
>
> My CGI script looks like this...
>
> #!/usr/bin/perl -w
> use strict;
> use Keys::Dispatch;
> eval { Keys::Dispatch->dispatch };
> if ($@) {
>    print "Content-Type: text/html\n\n";
>    print '<pre>';
>    print "An error occurred: [EMAIL PROTECTED]"
>      . 'Please notify the adminstrator of this service.';
>    print '</pre>';
> }
>
> Where Keys::Dispatch is a subclass of CGI::Application::Dispatch 2_05.
> When something goes wrong in a CGI::Application module (I forgot to
> declare a variable, forgot a semi-colon etc) I get a 500 error in the
> browser and a premature end of script headers error in the logs rather
> then displaying the error as the code instructs. What is Dispatch
> doing that this old trick of mine doesn't work?

It's probably printing its own error page, which is reasonable
considering it doesn't believe it successfully dispatched to
application.

Quit trapping the death of ->dispatch and see what happens.

I think you might get a "File Not Found" in the browser. The message
isn't quite accurate. The truth is "unable to dispatch". But dispatching
URLS blurs the line between what corresponds to a real "file" and what 
doesn't, and 404/File Not Found seems perhaps the closest equivalent
standard.

    Mark

--
 . . . . . . . . . . . . . . . . . . . . . . . . . . . 
   Mark Stosberg            Principal Developer  
   [EMAIL PROTECTED]     Summersault, LLC     
   765-939-9301 ext 202     database driven websites
 . . . . . http://www.summersault.com/ . . . . . . . .


---------------------------------------------------------------------
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