summaryrefslogtreecommitdiff
path: root/lib/chef/exceptions.rb
diff options
context:
space:
mode:
authorLamont Granquist <lamont@scriptkiddie.org>2014-11-18 22:50:35 -0800
committerSerdar Sutay <serdar@opscode.com>2014-11-19 15:42:30 -0800
commit999793d7f8c23fd9a533d3c8dd5fa57e7405ebd1 (patch)
tree16df4c43cd85831aca2e24215bd69e2888bf6f22 /lib/chef/exceptions.rb
parent1d0ae0156e14d0366d8b171361613abeea92917c (diff)
downloadchef-999793d7f8c23fd9a533d3c8dd5fa57e7405ebd1.tar.gz
fix ImmutableAttributeModification exception
Diffstat (limited to 'lib/chef/exceptions.rb')
-rw-r--r--lib/chef/exceptions.rb7
1 files changed, 6 insertions, 1 deletions
diff --git a/lib/chef/exceptions.rb b/lib/chef/exceptions.rb
index 93fdd414e4..c8d26dbed2 100644
--- a/lib/chef/exceptions.rb
+++ b/lib/chef/exceptions.rb
@@ -162,7 +162,12 @@ class Chef
# Node::Attribute computes the merged version of of attributes
# and makes it read-only. Attempting to modify a read-only
# attribute will cause this error.
- class ImmutableAttributeModification < NoMethodError; end
+ class ImmutableAttributeModification < NoMethodError
+ def initialize
+ super "Node attributes are read-only when you do not specify which precedence level to set. " +
+ %Q(To set an attribute use code like `node.default["key"] = "value"')
+ end
+ end
# Merged node attributes are invalidated when the component
# attributes are updated. Attempting to read from a stale copy