From df2672ef84d28181aae24d46035c67986e4d6cb9 Mon Sep 17 00:00:00 2001 From: CyberLeo Date: Sat, 22 Nov 2014 05:42:31 -0600 Subject: [PATCH] Avoid trapping Exception; use StandardError instead --- lib/check.rb | 2 +- lib/check_exception.rb | 2 +- lib/checks.rb | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/check.rb b/lib/check.rb index 3af27d9..10bf25a 100644 --- a/lib/check.rb +++ b/lib/check.rb @@ -41,7 +41,7 @@ class Check perform_check @passed = true end - rescue Exception => err + rescue StandardError, Timeout::Error => err STDERR.puts "In #{type}(#{name}): #{err.class}: #{err.message}\n#{err.backtrace.join("\n")}" @error = "#{err.class}: #{err.message}" @passed = false diff --git a/lib/check_exception.rb b/lib/check_exception.rb index c086c4d..0f4e8fa 100644 --- a/lib/check_exception.rb +++ b/lib/check_exception.rb @@ -1,4 +1,4 @@ -class CheckException < Exception +class CheckException < StandardError attr_accessor :exception_type attr_accessor :data diff --git a/lib/checks.rb b/lib/checks.rb index 623ca77..1aa6c5e 100644 --- a/lib/checks.rb +++ b/lib/checks.rb @@ -63,7 +63,7 @@ class Checks @checks = Marshal.load(fp.read) fp.flock(File::LOCK_UN) end - rescue Exception => err + rescue StandardError => err @checks = [] end -- 2.45.0