Zonemaster/Engine/Exception.pm untested

filter: Statementstmt 0.0% 0 / 19 Branchbran n/a Conditioncond n/a MC/DCmcdc n/a Subroutinesub 0.0% 0 / 6 Podpod 0.0% 0 / 1 totaltotal 0.0% 0 / 26 CC 1 SCAR 6.9
CC
1
Cov
0%
string
2.0
BEGIN
2.0
BEGIN
2.0
CRAP 2.0
1 package Zonemaster::Engine::Exception;
2  
3 use v5.16.0;
4 use warnings;
5  
6 use version; our $VERSION = version->declare("v1.0.3");
7  
8 use Class::Accessor "antlers";
9  
10 use overload '""' => \&string;
11  
12 has 'message' => ( is => 'ro', isa => 'Str', required => 1 );
13  
14 sub string {
15 my ( $self ) = @_;
16  
17 return $self->message;
18 }
19  
20 1;
21  
22 =head1 NAME
23  
24 Zonemaster::Engine::Exception -- base class for Zonemaster::Engine exceptions
25  
26 =head1 SYNOPSIS
27  
28 die Zonemaster::Engine::Exception->new({ message => "This is an exception" });
29  
30 =head1 ATTRIBUTES
31  
32 =over
33  
34 =item message
35  
36 A string attribute holding a message for possible human consumption.
37  
38 =back
39  
40 =head1 METHODS
41  
42 =over
43  
44 =item string()
45  
46 Method that stringifies the object by returning the C<message> attribute.
47 Stringification is overloaded to this.
48  
49 =back
50  
51 =cut