package RSApache::Response::Error;

use strict;
use warnings;

use lib ('/app/tools/common/lib');
use Common::Consts qw(%URLS);

use RSApache::Response;
use base 'RSApache::Response';

use Apache2::Const qw(REDIRECT HTTP_MOVED_PERMANENTLY);

sub _init {
    my ( $self, $error ) = @_;

    $self->{error} = $error;
}

sub respond {
    my ( $self, $apache ) = @_;

    my $redirect = $Common::Consts::URLS{error};
    $apache->content_type("text/html");
    $apache->status(REDIRECT);
    $apache->header_out( 'Location' => $redirect );
    $apache->send_http_header();

    return REDIRECT;
}

###
1;    # Play nicely.
###

