From 12c179504669ad8c73ece18758aaf68c1c416a1e Mon Sep 17 00:00:00 2001 From: Tim Sharpe Date: Sun, 3 Feb 2019 11:16:25 +1100 Subject: [PATCH] (rubocop) Fix Style/RescueStandardError --- lib/vmfloaty/conf.rb | 2 +- lib/vmfloaty/utils.rb | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/lib/vmfloaty/conf.rb b/lib/vmfloaty/conf.rb index a232f8d..b1bfef1 100644 --- a/lib/vmfloaty/conf.rb +++ b/lib/vmfloaty/conf.rb @@ -8,7 +8,7 @@ class Conf conf = {} begin conf = YAML.load_file("#{Dir.home}/.vmfloaty.yml") - rescue + rescue StandardError STDERR.puts "WARNING: There was no config file at #{Dir.home}/.vmfloaty.yml" end conf diff --git a/lib/vmfloaty/utils.rb b/lib/vmfloaty/utils.rb index b42bfaa..9d0cc61 100644 --- a/lib/vmfloaty/utils.rb +++ b/lib/vmfloaty/utils.rb @@ -103,7 +103,7 @@ class Utils else raise "Invalid service type #{service.type}" end - rescue => e + rescue StandardError => e STDERR.puts("Something went wrong while trying to gather information on #{hostname}:") STDERR.puts(e) end @@ -128,7 +128,7 @@ class Utils missing = max - ready - pending char = 'o' puts "#{name.ljust(width)} #{(char*ready).green}#{(char*pending).yellow}#{(char*missing).red}" - rescue => e + rescue StandardError => e puts "#{name.ljust(width)} #{e.red}" end end @@ -147,7 +147,7 @@ class Utils missing = max - ready - pending char = 'o' puts "#{name.ljust(width)} #{(char*ready).green}#{(char*pending).yellow}#{(char*missing).red}" - rescue => e + rescue StandardError => e puts "#{name.ljust(width)} #{e.red}" end end