summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAdam Jacob <adam@hjksolutions.com>2008-09-08 17:07:39 -0700
committerAdam Jacob <adam@hjksolutions.com>2008-09-08 17:07:39 -0700
commit5987e76b77c65e427659340a1f90e59099cc26c8 (patch)
tree7a5be04cd8254bfc53378ed5b4c60d4e167b3410
parentdf601907c9bdbc856a5f28dc96df31bae8b7a5fb (diff)
downloadchef-5987e76b77c65e427659340a1f90e59099cc26c8.tar.gz
Rasing exceptions, expanding the path for the source line
-rw-r--r--lib/chef/resource.rb2
-rw-r--r--lib/chef/runner.rb4
2 files changed, 3 insertions, 3 deletions
diff --git a/lib/chef/resource.rb b/lib/chef/resource.rb
index afd7163a43..436906557c 100644
--- a/lib/chef/resource.rb
+++ b/lib/chef/resource.rb
@@ -44,7 +44,7 @@ class Chef
@allowed_actions = [ :nothing ]
@action = :nothing
@updated = false
- @source_line = caller(4).shift.gsub!(/^(.+):(.+):.+$/, '\1 line \2')
+ @source_line = ::File.expand_path(caller(4).shift.gsub!(/^(.+):(.+):.+$/, '\1 line \2'))
end
def action(arg=nil)
diff --git a/lib/chef/runner.rb b/lib/chef/runner.rb
index cd2126494a..969f42b4e3 100644
--- a/lib/chef/runner.rb
+++ b/lib/chef/runner.rb
@@ -80,8 +80,8 @@ class Chef
end
end
end
- rescue Exception => e
- Chef::Log.error("#{resource} (#{resource.source_line} had an error:")
+ rescue
+ Chef::Log.error("#{resource} (#{resource.source_line}) had an error:")
raise e
end
end