package Apache::Carp;
# File: Apache/Carp.pm
use strict;
use Apache::Constants qw(:common);
use CGI qw(:html);

sub handler {
    my $r = shift;
    my $odor = $r->err_header_out('X-Odor');
    $odor ||= 'unspecified odor';
    $r->content_type('text/html');
    $r->send_http_header;
    return OK if $r->header_only;

    my $original_request = $r->prev;
    my $original_uri = $original_request ? $original_request->uri : '';
    my $admin = $r->server->server_admin;

    $r->print(
	      start_html(-title => 'Phew!!', -bgcolor => 'white'),
	      h1('Phew!!'),
	      p("Something fishy happened while processing this request."),
	      p("The odor was ", strong($odor), '.'),
	      hr,
	      address(a({-href => "mailto:$admin"}, 'webmaster')),
	      end_html
	      );

    return OK;
}

1;
__END__
