File tree Expand file tree Collapse file tree 2 files changed +3
-0
lines changed Expand file tree Collapse file tree 2 files changed +3
-0
lines changed Original file line number Diff line number Diff line change @@ -375,6 +375,7 @@ sub _stdin {
375
375
my $stream = Mojo::IOLoop::Stream-> new($handle );
376
376
377
377
Scalar::Util::weaken($self );
378
+ $stream -> on(error => sub { $! == 9 ? shift -> close : return $self -> emit(error => $_ [1]); });
378
379
$stream -> reactor($self -> reactor);
379
380
$stream -> timeout(0);
380
381
$stream -> start;
Original file line number Diff line number Diff line change @@ -8,6 +8,7 @@ use Test::Memory::Cycle;
8
8
my $output = ' ' ;
9
9
10
10
$run -> on(close => sub { Mojo::IOLoop-> stop; });
11
+ $run -> on(error => sub { diag " error: @_ " });
11
12
$run -> on(read => sub { $output .= $_ [1]; });
12
13
$run -> write (" line one\n line two\n " , sub { shift -> close (' stdin' ); });
13
14
$run -> run(sub { print while <>; print " FORCE\n " ; });
@@ -23,6 +24,7 @@ use Test::Memory::Cycle;
23
24
my $output = ' ' ;
24
25
25
26
$run -> on(close => sub { Mojo::IOLoop-> stop; });
27
+ $run -> on(error => sub { diag " error: @_ " });
26
28
$run -> on(read => sub { $output .= $_ [1]; shift -> close_gracefully(' stdin' ); });
27
29
$run -> write (" line one\n line two\n " );
28
30
$run -> run(sub { print while <>; print " GRACEFUL\n " });
You can’t perform that action at this time.
0 commit comments