line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package IO::Framed::X::ReadError; |
2
|
|
|
|
|
|
|
|
3
|
|
|
|
|
|
|
=encoding utf-8 |
4
|
|
|
|
|
|
|
|
5
|
|
|
|
|
|
|
=head1 NAME |
6
|
|
|
|
|
|
|
|
7
|
|
|
|
|
|
|
IO::Framed::X::ReadError |
8
|
|
|
|
|
|
|
|
9
|
|
|
|
|
|
|
=head1 SYNOPSIS |
10
|
|
|
|
|
|
|
|
11
|
|
|
|
|
|
|
use Try::Tiny; |
12
|
|
|
|
|
|
|
use IO::Framed::Read; |
13
|
|
|
|
|
|
|
|
14
|
|
|
|
|
|
|
my $iof = IO::Framed::Read->new( $some_socket ); |
15
|
|
|
|
|
|
|
|
16
|
|
|
|
|
|
|
try { $iof->read(20) } |
17
|
|
|
|
|
|
|
catch { |
18
|
|
|
|
|
|
|
$_->get('OS_ERROR'); #gets $! |
19
|
|
|
|
|
|
|
$_->errno_is('EAGAIN'); #should always be false |
20
|
|
|
|
|
|
|
}; |
21
|
|
|
|
|
|
|
|
22
|
|
|
|
|
|
|
=head1 DESCRIPTION |
23
|
|
|
|
|
|
|
|
24
|
|
|
|
|
|
|
Thrown on read errors. Subclasses L. |
25
|
|
|
|
|
|
|
|
26
|
|
|
|
|
|
|
=cut |
27
|
|
|
|
|
|
|
|
28
|
1
|
|
|
1
|
|
518
|
use strict; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
30
|
|
29
|
1
|
|
|
1
|
|
5
|
use warnings; |
|
1
|
|
|
|
|
3
|
|
|
1
|
|
|
|
|
28
|
|
30
|
|
|
|
|
|
|
|
31
|
1
|
|
|
1
|
|
6
|
use parent qw( IO::Framed::X::ErrnoBase ); |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
5
|
|
32
|
|
|
|
|
|
|
|
33
|
|
|
|
|
|
|
sub _new { |
34
|
1
|
|
|
1
|
|
188
|
my ($class, $err) = @_; |
35
|
|
|
|
|
|
|
|
36
|
1
|
|
|
|
|
8
|
return $class->SUPER::_new( "Read error: $err", OS_ERROR => $err ); |
37
|
|
|
|
|
|
|
} |
38
|
|
|
|
|
|
|
|
39
|
|
|
|
|
|
|
1; |