| 1 | package Linux::Event::Error; | ||||||||||||||||||||||||||||||
| 2 | 144 | ▶ | use v5.36; | ||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||
| 3 | 144 | ▶ | use strict; | ||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||
| 4 | 144 | ▶ | use warnings; | ||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||
| 5 | |||||||||||||||||||||||||||||||
| 6 | 144 | our $VERSION = '0.119'; | |||||||||||||||||||||||||||||
| 7 | |||||||||||||||||||||||||||||||
| 8 | 144 | ▶ | use overload '""' => 'as_string', fallback => 1; | ||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||
| 9 | |||||||||||||||||||||||||||||||
| 10 | 72 | ▶ | sub new ($class, %arg) { | ||||||||||||||||||||||||||||
|
Subroutine
new: called CC=4 SCAR=14.8
Pod
undocumented
| |||||||||||||||||||||||||||||||
| 11 | return bless { | ||||||||||||||||||||||||||||||
| 12 | type => $arg{type} // 'event', | ||||||||||||||||||||||||||||||
| 13 | operation => $arg{operation}, | ||||||||||||||||||||||||||||||
| 14 | option => $arg{option}, | ||||||||||||||||||||||||||||||
| 15 | errno => $arg{errno}, | ||||||||||||||||||||||||||||||
| 16 | message => $arg{message} // 'Linux::Event error', | ||||||||||||||||||||||||||||||
| 17 | pending_bytes => $arg{pending_bytes}, | ||||||||||||||||||||||||||||||
| 18 | pending_datagrams => $arg{pending_datagrams}, | ||||||||||||||||||||||||||||||
| 19 | datagram_size => $arg{datagram_size}, | ||||||||||||||||||||||||||||||
| 20 | limit => $arg{limit}, | ||||||||||||||||||||||||||||||
| 21 | fatal => $arg{fatal} ? 1 : 0, | ||||||||||||||||||||||||||||||
| 22 | host => $arg{host}, | ||||||||||||||||||||||||||||||
| 23 | port => $arg{port}, | ||||||||||||||||||||||||||||||
| 24 | path => $arg{path}, | ||||||||||||||||||||||||||||||
| 25 | family => $arg{family}, | ||||||||||||||||||||||||||||||
| 26 | attempts => $arg{attempts}, | ||||||||||||||||||||||||||||||
| 27 | resolver_message => $arg{resolver_message}, | ||||||||||||||||||||||||||||||
| 28 | timeout => $arg{timeout}, | ||||||||||||||||||||||||||||||
| 29 | deadline => $arg{deadline}, | ||||||||||||||||||||||||||||||
| 30 | 72 | ▶ | }, $class; | ||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition50%2/4
$arg{"type"} // "event"
$arg{"message"} // "Linux::Event error"
MC/DC0%0/1
$arg{"type"} // "event"
$arg{"type"}
MC/DC0%0/1
$arg{"message"} // "Linux::Event error"
$arg{"message"}
Truth table50%1/2
A
A= $arg{"type"}
Truth table50%1/2
A
A= $arg{"message"}
| |||||||||||||||||||||||||||||||
| 31 | } | ||||||||||||||||||||||||||||||
| 32 | |||||||||||||||||||||||||||||||
| 33 | 36 | ▶ | sub type ($self) { $self->{type} } | ||||||||||||||||||||||||||||
|
Subroutine
type: called CC=1 SCAR=0.0
Pod
documented
| |||||||||||||||||||||||||||||||
| 34 | 32 | ▶ | sub operation ($self) { $self->{operation} } | ||||||||||||||||||||||||||||
|
Subroutine
operation: called CC=1 SCAR=0.0
Pod
documented
| |||||||||||||||||||||||||||||||
| 35 | 6 | ▶ | sub option ($self) { $self->{option} } | ||||||||||||||||||||||||||||
|
Subroutine
option: called CC=1 SCAR=0.0
Pod
documented
| |||||||||||||||||||||||||||||||
| 36 | 1 | ▶ | sub errno ($self) { $self->{errno} } | ||||||||||||||||||||||||||||
|
Subroutine
errno: called CC=1 SCAR=0.0
Pod
documented
| |||||||||||||||||||||||||||||||
| 37 | 8 | ▶ | sub message ($self) { $self->{message} } | ||||||||||||||||||||||||||||
|
Subroutine
message: called CC=1 SCAR=0.0
Pod
documented
| |||||||||||||||||||||||||||||||
| 38 | 2 | ▶ | sub pending_bytes ($self) { $self->{pending_bytes} } | ||||||||||||||||||||||||||||
|
Subroutine
pending_bytes: called CC=1 SCAR=0.0
Pod
documented
| |||||||||||||||||||||||||||||||
| 39 | 1 | ▶ | sub pending_datagrams ($self) { $self->{pending_datagrams} } | ||||||||||||||||||||||||||||
|
Subroutine
pending_datagrams: called CC=1 SCAR=0.0
Pod
documented
| |||||||||||||||||||||||||||||||
| 40 | 1 | ▶ | sub datagram_size ($self) { $self->{datagram_size} } | ||||||||||||||||||||||||||||
|
Subroutine
datagram_size: called CC=1 SCAR=0.0
Pod
documented
| |||||||||||||||||||||||||||||||
| 41 | 4 | ▶ | sub limit ($self) { $self->{limit} } | ||||||||||||||||||||||||||||
|
Subroutine
limit: called CC=1 SCAR=0.0
Pod
documented
| |||||||||||||||||||||||||||||||
| 42 | 2 | ▶ | sub fatal ($self) { $self->{fatal} } | ||||||||||||||||||||||||||||
|
Subroutine
fatal: called CC=1 SCAR=0.0
Pod
documented
| |||||||||||||||||||||||||||||||
| 43 | 1 | ▶ | sub host ($self) { $self->{host} } | ||||||||||||||||||||||||||||
|
Subroutine
host: called CC=1 SCAR=0.0
Pod
documented
| |||||||||||||||||||||||||||||||
| 44 | 0 | ▶ | sub port ($self) { $self->{port} } | ||||||||||||||||||||||||||||
|
Subroutine
port: not called CC=1 SCAR=6.9
Pod
documented
| |||||||||||||||||||||||||||||||
| 45 | 0 | ▶ | sub path ($self) { $self->{path} } | ||||||||||||||||||||||||||||
|
Subroutine
path: not called CC=1 SCAR=6.9
Pod
documented
| |||||||||||||||||||||||||||||||
| 46 | 0 | ▶ | sub family ($self) { $self->{family} } | ||||||||||||||||||||||||||||
|
Subroutine
family: not called CC=1 SCAR=6.9
Pod
documented
| |||||||||||||||||||||||||||||||
| 47 | 1 | ▶ | sub attempts ($self) { $self->{attempts} } | ||||||||||||||||||||||||||||
|
Subroutine
attempts: called CC=1 SCAR=0.0
Pod
documented
| |||||||||||||||||||||||||||||||
| 48 | 0 | ▶ | sub resolver_message ($self) { $self->{resolver_message} } | ||||||||||||||||||||||||||||
|
Subroutine
resolver_message: not called CC=1 SCAR=6.9
Pod
documented
| |||||||||||||||||||||||||||||||
| 49 | 1 | ▶ | sub timeout ($self) { $self->{timeout} } | ||||||||||||||||||||||||||||
|
Subroutine
timeout: called CC=1 SCAR=0.0
Pod
documented
| |||||||||||||||||||||||||||||||
| 50 | 1 | ▶ | sub deadline ($self) { $self->{deadline} } | ||||||||||||||||||||||||||||
|
Subroutine
deadline: called CC=1 SCAR=0.0
Pod
documented
| |||||||||||||||||||||||||||||||
| 51 | |||||||||||||||||||||||||||||||
| 52 | 29 | ▶ | sub as_string ($self, @ignored) { | ||||||||||||||||||||||||||||
|
Subroutine
as_string: called CC=3 SCAR=11.0
Pod
documented
| |||||||||||||||||||||||||||||||
| 53 | 29 | my $text = $self->{message}; | |||||||||||||||||||||||||||||
| 54 | 29 | ▶ | $text = "$self->{operation}: $text" if defined $self->{operation}; | ||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||
| 55 | 29 | ▶ | $text .= " (errno=$self->{errno})" if defined $self->{errno}; | ||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||
| 56 | 29 | return $text; | |||||||||||||||||||||||||||||
| 57 | } | ||||||||||||||||||||||||||||||
| 58 | |||||||||||||||||||||||||||||||
| 59 | 144 | 1; | |||||||||||||||||||||||||||||
| 60 | |||||||||||||||||||||||||||||||
| 61 | __END__ | ||||||||||||||||||||||||||||||