BoardStreams/Error.pm untested

filter: Statementstmt 0.0% 0 / 22 Branchbran 0.0% 0 / 2 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 0.0% 0 / 5 Podpod n/a totaltotal 0.0% 0 / 29 CC 1 SCAR 6.9
CC
1
Cov
0%
BEGIN
2.0
BEGIN
2.0
BEGIN
2.0
CRAP 2.0
1 package BoardStreams::Error;
2  
3 use Moo;
4 with 'Throwable';
5  
6 use BoardStreams::Util 'make_one_line';
7  
8 use Data::Dump 'dump';
9  
10 use experimental 'signatures';
11  
12 use overload '""' => sub {
13 my $text = ref($_[0]) . '=' . dump({
14 code => $_[0]->code,
15 $_[0]->has_data ? (data => $_[0]->data) : (),
16 });
17 return make_one_line $text;
18 };
19  
20 our $VERSION = "v0.0.36";
21  
22 has code => (
23 is => 'ro',
24 required => 1,
25 );
26  
27 has data => (
28 is => 'ro',
29 predicate => 1,
30 );
31  
32 1;