summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLamont Granquist <lamont@scriptkiddie.org>2019-07-08 17:10:44 -0700
committerLamont Granquist <lamont@scriptkiddie.org>2019-07-08 17:10:44 -0700
commite5912566d15f7cc5ade38b6eaee1ecf9d975be6e (patch)
tree7cf281e0cdb73d449b5919437da1abe707187c24
parentb004803a852485729493ac04c2cf13f59b55d7f3 (diff)
downloadohai-e5912566d15f7cc5ade38b6eaee1ecf9d975be6e.tar.gz
fix odd exception shadowing
Signed-off-by: Lamont Granquist <lamont@scriptkiddie.org>
-rw-r--r--lib/ohai/loader.rb4
-rw-r--r--lib/ohai/runner.rb4
2 files changed, 4 insertions, 4 deletions
diff --git a/lib/ohai/loader.rb b/lib/ohai/loader.rb
index 329a7f5a..a83cb56c 100644
--- a/lib/ohai/loader.rb
+++ b/lib/ohai/loader.rb
@@ -1,6 +1,6 @@
#
# Author:: Claire McQuin (<claire@chef.io>)
-# Copyright:: Copyright (c) 2013-2016 Chef Software, Inc.
+# Copyright:: Copyright (c) 2013-2019, Chef Software Inc.
# License:: Apache License, Version 2.0
#
# Licensed under the Apache License, Version 2.0 (the "License");
@@ -164,7 +164,7 @@ module Ohai
logger.warn("Plugin Syntax Error: <#{plugin_path}>: #{part}")
end
- rescue Exception, Errno::ENOENT => e
+ rescue Exception => e
logger.warn("Plugin Error: <#{plugin_path}>: #{e.message}")
logger.trace("Plugin Error: <#{plugin_path}>: #{e.inspect}, #{e.backtrace.join('\n')}")
end
diff --git a/lib/ohai/runner.rb b/lib/ohai/runner.rb
index 0571d935..bc69bc9c 100644
--- a/lib/ohai/runner.rb
+++ b/lib/ohai/runner.rb
@@ -1,6 +1,6 @@
#
# Author:: Claire McQuin (<claire@chef.io>)
-# Copyright:: Copyright (c) 2013-2016 Chef Software, Inc.
+# Copyright:: Copyright (c) 2013-2019, Chef Software Inc.
# License:: Apache License, Version 2.0
#
# Licensed under the Apache License, Version 2.0 (the "License"); you
@@ -53,7 +53,7 @@ module Ohai
raise
rescue SystemExit # abort or exit from plug-in should exit Ohai with failure code
raise
- rescue Exception, Errno::ENOENT => e
+ rescue Exception => e
logger.trace("Plugin #{plugin.name} threw exception #{e.inspect} #{e.backtrace.join("\n")}")
end
end