summaryrefslogtreecommitdiff
path: root/lib/chef/exceptions.rb
diff options
context:
space:
mode:
Diffstat (limited to 'lib/chef/exceptions.rb')
-rw-r--r--lib/chef/exceptions.rb14
1 files changed, 5 insertions, 9 deletions
diff --git a/lib/chef/exceptions.rb b/lib/chef/exceptions.rb
index 6fe364a91b..96eca839dd 100644
--- a/lib/chef/exceptions.rb
+++ b/lib/chef/exceptions.rb
@@ -24,7 +24,6 @@ class Chef
# Chef's custom exceptions are all contained within the Chef::Exceptions
# namespace.
class Exceptions
-
ConfigurationError = ChefConfig::ConfigurationError
# Backcompat with Chef::ShellOut code:
@@ -33,7 +32,7 @@ class Chef
def self.const_missing(const_name)
if const_name == :ShellCommandFailed
Chef::Log.warn("Chef::Exceptions::ShellCommandFailed is deprecated, use Mixlib::ShellOut::ShellCommandFailed")
- called_from = caller[0..3].inject("Called from:\n") {|msg, trace_line| msg << " #{trace_line}\n" }
+ called_from = caller[0..3].inject("Called from:\n") { |msg, trace_line| msg << " #{trace_line}\n" }
Chef::Log.warn(called_from)
Mixlib::ShellOut::ShellCommandFailed
else
@@ -250,7 +249,7 @@ class Chef
attr_reader :expansion
- def initialize(message_or_expansion=NULL)
+ def initialize(message_or_expansion = NULL)
@expansion = nil
case message_or_expansion
when NULL
@@ -263,7 +262,6 @@ class Chef
super("The expanded run list includes nonexistent roles: #{missing_roles}")
end
end
-
end
# Exception class for collecting multiple failures. Used when running
# delayed notifications so that chef can process each delayed
@@ -310,7 +308,6 @@ class Chef
end
class CookbookVersionSelection
-
# Compound exception: In run_list expansion and resolution,
# run_list items referred to cookbooks that don't exist and/or
# have no versions available.
@@ -369,7 +366,6 @@ class Chef
Chef::JSONCompat.to_json(result, *a)
end
end
-
end # CookbookVersionSelection
# When the server sends a redirect, RFC 2616 states a user-agent should
@@ -449,7 +445,7 @@ This error is most often caused by network issues (proxies, etc) outside of chef
class RunFailedWrappingError < RuntimeError
attr_reader :wrapped_errors
def initialize(*errors)
- errors = errors.select {|e| !e.nil?}
+ errors = errors.select { |e| !e.nil? }
output = "Found #{errors.size} errors, they are stored in the backtrace"
@wrapped_errors = errors
super output
@@ -457,8 +453,8 @@ This error is most often caused by network issues (proxies, etc) outside of chef
def fill_backtrace
backtrace = []
- wrapped_errors.each_with_index do |e,i|
- backtrace << "#{i+1}) #{e.class} - #{e.message}"
+ wrapped_errors.each_with_index do |e, i|
+ backtrace << "#{i + 1}) #{e.class} - #{e.message}"
backtrace += e.backtrace if e.backtrace
backtrace << "" unless i == wrapped_errors.length - 1
end