Agent/Error.pm

filter: Statementstmt 100% 42 / 42 Branchbran n/a Conditioncond 50.0% 1 / 2 MC/DCmcdc 0.0% 0 / 1 Subroutinesub 100% 15 / 15 Podpod 100% 2 / 2 totaltotal 96.7% 60 / 62 CC 2 SCAR 1.2
CC
2
Cov
98%
to_string
2.0
BEGIN
1.0
BEGIN
1.0
CRAP 1.1
« Agent/Permission/Result.pm ↑ Summary Agent/Message/RateLimitEvent.pm »
1 package Claude::Agent::Error;
2  
3 9 ▶use 5.020;
Subroutine BEGIN: called CC=1 SCAR=0.0
4 9 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
5 9 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
6  
7 9 ▶use Object::Proto ();
Subroutine BEGIN: called CC=1 SCAR=0.0
8  
9 9 ▶BEGIN {
Subroutine BEGIN: called CC=1 SCAR=0.0
10 9 Object::Proto::define('Claude::Agent::Error',
11 'message:Str:required',
12 );
13 }
14  
15 use overload
16 16 ▶ '""' => sub { shift->to_string },
Subroutine BEGIN: called CC=1 SCAR=0.0
Subroutine __ANON__: called CC=1 SCAR=0.0
17 9 fallback => 1;
18  
19 12 ▶sub throw {
Subroutine throw: called CC=1 SCAR=0.0
Pod documented
20 12 my ($class, %args) = @_;
21 12 die $class->new(%args);
22 }
23  
24 17 ▶sub to_string {
Subroutine to_string: called CC=2 SCAR=7.0
Pod documented
25 17 my ($self) = @_;
26 17 my $type = ref($self);
27 17 $type =~ s/^Claude::Agent::Error:://;
28 17 ▶ $type ||= 'Error';
Condition50%1/2
$type ||= "Error"
l!l
170
MC/DC0%0/1
$type ||= "Error"
$type
Truth table50%1/2
A
A= $type
Aresult
11
00
29 17 return "$type: " . $self->message;
30 }
31  
32 9 ▶use Claude::Agent::Error::CLINotFound;
Subroutine BEGIN: called CC=1 SCAR=0.0
33 9 ▶use Claude::Agent::Error::ProcessError;
Subroutine BEGIN: called CC=1 SCAR=0.0
34 9 ▶use Claude::Agent::Error::JSONDecodeError;
Subroutine BEGIN: called CC=1 SCAR=0.0
35 9 ▶use Claude::Agent::Error::TimeoutError;
Subroutine BEGIN: called CC=1 SCAR=0.0
36 9 ▶use Claude::Agent::Error::PermissionDenied;
Subroutine BEGIN: called CC=1 SCAR=0.0
37 9 ▶use Claude::Agent::Error::HookError;
Subroutine BEGIN: called CC=1 SCAR=0.0
38  
39 9 1;
40  
41 __END__
« Agent/Permission/Result.pm ↑ Summary Agent/Message/RateLimitEvent.pm »