Permalink
Browse files

Make sure Errno::ENOENT is raised when File.stat() fails

EventMachine::FileTail#handle_eof() is expecting an ENOENT when a stat
fails, but instead is getting back a nil stat struct.
  • Loading branch information...
1 parent c368b59 commit dd3b47fbe683559e259aa7233b85e7c35b074368 @eric eric committed Feb 13, 2012
Showing with 2 additions and 0 deletions.
  1. 0 bin/emtail
  2. 0 bin/rtail
  3. +2 −0 lib/em/filetail.rb
View
0 bin/emtail 100644 → 100755
No changes.
View
0 bin/rtail 100644 → 100755
No changes.
View
@@ -354,6 +354,8 @@ def handle_eof
def read_file_metadata(&block)
begin
filestat = File.stat(@path)
+ rescue Errno::ENOENT
+ raise
rescue => e
@logger.debug("File stat on '#{@path}' failed")
on_exception e

0 comments on commit dd3b47f

Please sign in to comment.