D
Denis Berezhnoy
Hi guys!
I have problem that I can not catch PTY::ChildExited exception. Here is
the code:
require 'pty'
cmd = "/home3/cman/work/product/integrator/test/syb2/OCS-15_0/bin/isql
-Uuser2 -Puser2 -Scman2"
begin
pipe_read, pipe_write, pid = PTY.spawn(cmd)
rescue PTY::ChildExited => msg
puts "Caught child exited exception!"
rescue => msg
puts "Caught exception!"
end
sleep 10
printf "TEST END\n"
When I run it I have the following:
pty_test.rb:7: pty - exited: 1278 (PTY::ChildExited)
I am wondering why exception is not caught? What is more when I remove
sleep operator then there is no exception at all. Script works and
prints TEST END.
My environment:
ruby 1.8.7 (2008-06-20 patchlevel 22) [x86_64-linux]
Linux 2.6.24-23-server #1 SMP Mon Jan 26 01:36:05 UTC 2009 x86_64
GNU/Linux
What I am doing wrong?
Best regards.
Denis
I have problem that I can not catch PTY::ChildExited exception. Here is
the code:
require 'pty'
cmd = "/home3/cman/work/product/integrator/test/syb2/OCS-15_0/bin/isql
-Uuser2 -Puser2 -Scman2"
begin
pipe_read, pipe_write, pid = PTY.spawn(cmd)
rescue PTY::ChildExited => msg
puts "Caught child exited exception!"
rescue => msg
puts "Caught exception!"
end
sleep 10
printf "TEST END\n"
When I run it I have the following:
pty_test.rb:7: pty - exited: 1278 (PTY::ChildExited)
I am wondering why exception is not caught? What is more when I remove
sleep operator then there is no exception at all. Script works and
prints TEST END.
My environment:
ruby 1.8.7 (2008-06-20 patchlevel 22) [x86_64-linux]
Linux 2.6.24-23-server #1 SMP Mon Jan 26 01:36:05 UTC 2009 x86_64
GNU/Linux
What I am doing wrong?
Best regards.
Denis