summaryrefslogtreecommitdiff
path: root/lib/WWW/Efa/Error/Backend.pm
blob: 930fed5868007e15533192d1e8be9a9311eee89c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
package WWW::Efa::Error::Backend;

=head1 NAME

WWW::Efa::Error::Backend - WWW::Efa unknown error from efa.vrr.de

=head1 SYNOPSIS

    use WWW::Efa::Error::Backend;

    my $error = WWW::Efa::Error::Backend->new(
        'Yadda Yadda'
    );

    die $error->as_string();
    # WWW::Efa error from efa.vrr.de:
    # Yadda Yadda

=head1 DESCRIPTION

Received an unknown error from efa.vrr.de

=cut

use strict;
use warnings;
use 5.010;

use base 'Exporter';

our @EXPORT_OK = qw{};
our @ISA = ('WWW::Efa::Error');

sub new {
	my ($obj, $msg) = @_;
	my $ref = {};

	$ref->{'message'} = $msg;

	return bless($ref, $obj);
}

=head1 METHODS

=head2 $error->as_string()

Return the error as string, can directly be displayed to the user

=cut

sub as_string {
	my ($self) = @_;

	return sprintf(
		"WWW::Efa error from efa.vrr.de:\n%s\n",
		$self->{'message'},
	);
}

1;