summaryrefslogtreecommitdiff
path: root/lib/custodian
diff options
context:
space:
mode:
authorSteve Kemp <steve@steve.org.uk>2012-11-15 08:17:13 +0000
committerSteve Kemp <steve@steve.org.uk>2012-11-15 08:17:13 +0000
commitd896e42306c5c7761a14a2d88b6d2ed04401b03c (patch)
tree6689009b26dc65f6a0f8604d1ae84613cc22cb3a /lib/custodian
parent6c78bd44932582c29ca04f826c21e3ede81dd898 (diff)
Throw an exception if we attempt to redefine a macro.
Diffstat (limited to 'lib/custodian')
-rwxr-xr-xlib/custodian/parser.rb4
1 files changed, 4 insertions, 0 deletions
diff --git a/lib/custodian/parser.rb b/lib/custodian/parser.rb
index 7ed7a51..268dd3b 100755
--- a/lib/custodian/parser.rb
+++ b/lib/custodian/parser.rb
@@ -190,6 +190,10 @@ class MonitorConfig
end
+ if ( is_macro?( name ) )
+ raise ArgumentError, "The macro #{name} is already defined"
+ end
+
@MACROS[name] = val
end