summaryrefslogtreecommitdiffstats
path: root/lib/puppet/error.rb
diff options
context:
space:
mode:
authorluke <luke@980ebf18-57e1-0310-9a29-db15c13687c0>2007-03-19 19:16:10 +0000
committerluke <luke@980ebf18-57e1-0310-9a29-db15c13687c0>2007-03-19 19:16:10 +0000
commit9b5833a63cc88fff7ce8e157e6ab079d3fd3f631 (patch)
treef367096862d5f24cd55bcb0b88e4a2efd41682dc /lib/puppet/error.rb
parent1f8b768e4ebef4e9ee54ee96db2544d6f9522bbf (diff)
downloadpuppet-9b5833a63cc88fff7ce8e157e6ab079d3fd3f631.tar.gz
puppet-9b5833a63cc88fff7ce8e157e6ab079d3fd3f631.tar.xz
puppet-9b5833a63cc88fff7ce8e157e6ab079d3fd3f631.zip
Clarifying the errors a bit when nodes come from external sources.
git-svn-id: https://reductivelabs.com/svn/puppet/trunk@2324 980ebf18-57e1-0310-9a29-db15c13687c0
Diffstat (limited to 'lib/puppet/error.rb')
-rw-r--r--lib/puppet/error.rb6
1 files changed, 4 insertions, 2 deletions
diff --git a/lib/puppet/error.rb b/lib/puppet/error.rb
index b70a4dddf..10ccf47be 100644
--- a/lib/puppet/error.rb
+++ b/lib/puppet/error.rb
@@ -22,12 +22,14 @@ module Puppet # :nodoc:
def to_s
str = nil
- if defined? @file and defined? @line and @file and @line
+ if self.file and self.line
str = "%s at %s:%s" %
[@message.to_s, @file, @line]
- elsif defined? @line and @line
+ elsif self.line
str = "%s at line %s" %
[@message.to_s, @line]
+ elsif self.file
+ str = "%s in %s" % [@message.to_s, self.file]
else
str = @message.to_s
end