| 1 | package IO::Framed::X::EmptyRead; | ||
| 2 | |||
| 3 | =encoding utf-8 | ||
| 4 | |||
| 5 | =head1 NAME | ||
| 6 | |||
| 7 | IO::Framed::X::EmptyRead | ||
| 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 | if ( try { $_->isa('IO::Framed::Read') } ) { ... } | ||
| 19 | }; | ||
| 20 | |||
| 21 | =head1 DESCRIPTION | ||
| 22 | |||
| 23 | Thrown when a read operation returns empty but without an error from the | ||
| 24 | operating system. This isn’t an *error* so much as just an “exceptional | ||
| 25 | condition” that so radically changes the application state that it’s | ||
| 26 | worth throwing on. | ||
| 27 | |||
| 28 | You should probably always trap this error so you can cleanly shut things | ||
| 29 | down. | ||
| 30 | |||
| 31 | =cut | ||
| 32 | |||
| 33 | 1 | ▶ | use strict; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 34 | 1 | ▶ | use warnings; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 35 | |||
| 36 | 1 | ▶ | use parent qw( X::Tiny::Base ); |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 37 | |||
| 38 | sub _new { | ||
| 39 | 1 | ▶ | my ($class) = @_; |
|
Subroutine
_new: called CC=1 SCAR=0.0
| |||
| 40 | |||
| 41 | 1 | return $class->SUPER::_new( 'Got empty read; EOF?' ); | |
| 42 | } | ||
| 43 | |||
| 44 | 1 | 1; | |