Skip to content

Commit da99da4

Browse files
committed
Removed strict condition to identify corrupted gzip
1 parent 24e9361 commit da99da4

File tree

1 file changed

+3
-6
lines changed

1 file changed

+3
-6
lines changed

Diff for: lib/filewatch/read_mode/handlers/read_zip_file.rb

+3-6
Original file line numberDiff line numberDiff line change
@@ -79,12 +79,9 @@ def corrupted?(watched_file)
7979
end
8080
return false
8181
rescue ZipException => e
82-
if e.message == 'invalid bit length repeat'
83-
duration = Time.now - start
84-
logger.warn("#{watched_file.path} is corrupted, #{duration} secs")
85-
return true
86-
end
87-
raise ZipException.new(e)
82+
duration = Time.now - start
83+
logger.warn("#{watched_file.path} is corrupted, #{duration} secs, message: #{e.message}")
84+
return true
8885
ensure
8986
close_and_ignore_ioexception(gzip_stream) unless gzip_stream.nil?
9087
close_and_ignore_ioexception(file_stream) unless file_stream.nil?

0 commit comments

Comments
 (0)