Hi,

I have the following handler in my session_handler.pl, what I want to
know is how to make it return a 404 error if there is an error.
Currently it returns a custom error page but with a 200 status. The
handler looks like:

<code>
sub handler
{
    my ($r) = @_;

    my $site =$r->dir_config('SiteName');

    return -1 unless exists $ah{$site};
    return -1 if $r->content_type && $r->content_type !~ m|^text/|io;

    my $status = eval{ $ah{$site}->handle_request($r) };
    if (my $err = $@ ) {
      $r->pnotes(error => $err);
      $r->filename($r->document_root . '/error.html');

      return $ah{$site}->handle_request($r);
    }

    return $status;
}

1;
</code>

I've read that you should look out for 404 errors when doing custom
error pages, and make sure they return 404 errors.

Can I put something here or in the error.html?

Justin




-------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc. Do you grep through log files
for problems?  Stop!  Download the new AJAX search engine that makes
searching your log files as easy as surfing the  web.  DOWNLOAD SPLUNK!
http://ads.osdn.com/?ad_id=7637&alloc_id=16865&op=click
_______________________________________________
Mason-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/mason-users

Reply via email to