Skip to content

Commit 8ad6d18

Browse files
author
James Pogran
authored
Merge pull request #50 from glennsarti/gh-49-stdio-loop
(GH-49) Exit STDIO loop if STDIN reaches EOF
2 parents 1e1e72e + 6954149 commit 8ad6d18

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

lib/puppet-editor-services/simple_stdio_server.rb

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,9 @@ def read_from_pipe(pipe, timeout = 0.1, &_block)
7878
l = nil
7979
begin
8080
l = pipe.readpartial(4096)
81+
rescue EOFError
82+
log('Reading from pipe has reached End of File. Exiting STDIO server')
83+
stop
8184
rescue # rubocop:disable Style/RescueStandardError, Lint/HandleExceptions
8285
# Any errors here should be swallowed because the pipe could be in any state
8386
end

0 commit comments

Comments
 (0)