package Apache::AxKit::Provider::Error;
use strict;
use vars qw/@ISA/;
@ISA = ('Apache::AxKit::Provider');

use Apache;
use Apache::Log;
use Apache::AxKit::Exception;
use Apache::AxKit::Provider;
use Digest::MD5 qw(md5_base64);
use AxKit;

sub new {
    my $class = shift;
    my $apache = shift;
    my $self = bless { apache => $apache }, $class;
      
    return $self;
}

sub apache_request {
    my $self = shift;
    return $self->{apache};
}

sub process {
    my $self = shift;
    return 1;
}

sub exists {
    my $self = shift;
    return 1;
}

sub mtime {
    my $self = shift;
    return time(); # always fresh
}

sub get_fh {
    throw Apache::AxKit::Exception::IO( -text => "Can't get fh for Scalar" );
}

sub get_strref {
    my $self = shift;
	my $r = $self->{'apache'};
	
	my $str = $r->prev()->notes('axkit_error');
	    
    return \$str;
}

sub key{
	my $self = shift;
	my $str = ${$self->get_strref};
	return md5_base64($str);
}



1;
