| 1 | package Future::Uring::Exception; | ||
| 2 | 5 | $Future::Uring::Exception::VERSION = '0.005'; | |
| 3 | 5 | ▶ | use 5.020; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 4 | 5 | ▶ | use warnings; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 5 | 5 | ▶ | use experimental 'signatures'; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 6 | 5 | ▶ | use overload '""' => sub($self, $other, $flipped) { |
|
Subroutine
BEGIN: called CC=1 SCAR=0.2
Subroutine
__ANON__: not called CC=1 SCAR=6.9
| |||
| 7 | 0 | return $self->to_string; | |
| 8 | 5 | }; | |
| 9 | |||
| 10 | 5 | require Future::Uring; | |
| 11 | |||
| 12 | 0 | ▶ | sub new($class, $operation, $res, $filename, $line) { |
|
Subroutine
new: not called CC=1 SCAR=6.9
Pod
undocumented
| |||
| 13 | 0 | my $error = do { local $! = -$res; "$!" }; | |
| 14 | 0 | return bless { | |
| 15 | operation => $operation, | ||
| 16 | errno => -$res, | ||
| 17 | error => $error, | ||
| 18 | filename => $filename, | ||
| 19 | line => $line, | ||
| 20 | }, $class; | ||
| 21 | } | ||
| 22 | |||
| 23 | 0 | ▶ | sub operation($self) { |
|
Subroutine
operation: not called CC=1 SCAR=6.9
Pod
documented
| |||
| 24 | 0 | return $self->{operation}; | |
| 25 | } | ||
| 26 | |||
| 27 | 0 | ▶ | sub errno($self) { |
|
Subroutine
errno: not called CC=1 SCAR=6.9
Pod
documented
| |||
| 28 | 0 | return $self->{errno}; | |
| 29 | } | ||
| 30 | |||
| 31 | 0 | ▶ | sub error($self) { |
|
Subroutine
error: not called CC=1 SCAR=6.9
Pod
documented
| |||
| 32 | 0 | return $self->{error}; | |
| 33 | } | ||
| 34 | |||
| 35 | 0 | ▶ | sub filename($self) { |
|
Subroutine
filename: not called CC=1 SCAR=6.9
Pod
documented
| |||
| 36 | 0 | return $self->{filename}; | |
| 37 | } | ||
| 38 | |||
| 39 | 0 | ▶ | sub line($self) { |
|
Subroutine
line: not called CC=1 SCAR=6.9
Pod
documented
| |||
| 40 | 0 | return $self->{line}; | |
| 41 | } | ||
| 42 | |||
| 43 | 0 | ▶ | sub to_string($self) { |
|
Subroutine
to_string: not called CC=1 SCAR=6.9
Pod
documented
| |||
| 44 | 0 | return "$self->{operation}: $self->{error} at $self->{filename} line $self->{line}\n"; | |
| 45 | } | ||
| 46 | |||
| 47 | 0 | ▶ | sub PROPAGATE($self, $filename, $line) { |
|
Subroutine
PROPAGATE: not called CC=1 SCAR=6.9
Pod
undocumented
| |||
| 48 | return bless { | ||
| 49 | operation => $self->{operation}, | ||
| 50 | errno => $self->{errno}, | ||
| 51 | error => $self->{error}, | ||
| 52 | 0 | filename => $filename, | |
| 53 | line => $line, | ||
| 54 | }, ref $self; | ||
| 55 | } | ||
| 56 | |||
| 57 | 5 | 1; | |
| 58 | |||
| 59 | # ABSTRACT: an exception from Future::Uring | ||
| 60 | |||
| 61 | __END__ | ||