Skip to content

Commit a8a8c07

Browse files
authored
Remove unnecessary error log (#10)
The exception message will be output at the following location and it is enough. https://github.com/fluent-plugins-nursery/fluent-plugin-fluent-package-update-notifier/blob/9e2fcb61efdadcda241710afb60a8b03591c6851/lib/fluent/plugin/in_fluent_package_update_notifier.rb#L79 Related to #6 --------- Signed-off-by: Shizuo Fujita <[email protected]>
1 parent 911a7e4 commit a8a8c07

File tree

1 file changed

+10
-13
lines changed

1 file changed

+10
-13
lines changed

lib/fluent/plugin/fluent_package_update_checker.rb

Lines changed: 10 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ def tags_cached?
4242
end
4343

4444
def cached_tags_path
45-
ENV["FLUENT_PACKAGE_TAGS_PATH"] ?
45+
ENV["FLUENT_PACKAGE_TAGS_PATH"] ?
4646
ENV["FLUENT_PACKAGE_TAGS_PATH"] : "#{@tmp_dir}/fluent-package-tags.json"
4747
end
4848

@@ -51,20 +51,16 @@ def release_tags_url
5151
end
5252

5353
def fetch_tags
54-
begin
55-
if tags_cached?
56-
yield JSON.parse(File.open(cached_tags_path).read)
57-
else
58-
URI.open(release_tags_url) do |resource|
59-
File.open(cached_tags_path, "w+") do |f|
60-
json = resource.read
61-
f.write(json)
62-
yield JSON.parse(json)
63-
end
54+
if tags_cached?
55+
yield JSON.parse(File.open(cached_tags_path).read)
56+
else
57+
URI.open(release_tags_url) do |resource|
58+
File.open(cached_tags_path, "w+") do |f|
59+
json = resource.read
60+
f.write(json)
61+
yield JSON.parse(json)
6462
end
6563
end
66-
rescue => e
67-
@logger.error "Failed to fetch tags", error: e
6864
end
6965
end
7066

@@ -176,6 +172,7 @@ def check_update_versions
176172
end
177173
end
178174
end
175+
ensure
179176
FileUtils.rm_rf(@tmp_dir)
180177
end
181178

0 commit comments

Comments
 (0)