logo       
Google Custom Search
    AddThis Social Bookmark Button

Re: A small CGI::Application::Dispatch snag.: msg#00001

Subject: Re: A small CGI::Application::Dispatch snag.
On 2006-05-26, Timothy Appnel <tappnel-Re5JQEeQqe8AvxtiuMwx3w@xxxxxxxxxxxxxxxx> 
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: $@\n\n"
>      . '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  
   mark-WmyhgDpj2fCHT8/ATrE1yw@xxxxxxxxxxxxxxxx     Summersault, LLC     
   765-939-9301 ext 202     database driven websites
 . . . . . http://www.summersault.com/ . . . . . . . .


---------------------------------------------------------------------
Web Archive:  
http://www.mail-archive.com/cgiapp-svx1JCNWaqPWzzAP45jFb16hYfS7NtTn@xxxxxxxxxxxxxxxx/
              http://marc.theaimsgroup.com/?l=cgiapp&r=1&w=2
To unsubscribe, e-mail: 
cgiapp-unsubscribe-svx1JCNWaqPWzzAP45jFb16hYfS7NtTn@xxxxxxxxxxxxxxxx
For additional commands, e-mail: 
cgiapp-help-svx1JCNWaqPWzzAP45jFb16hYfS7NtTn@xxxxxxxxxxxxxxxx





Try Searching:
servers, voip, java, networking, microsoft ...
<Prev in Thread] Current Thread [Next in Thread>