diff options
author | elijah <elijah@riseup.net> | 2014-06-27 23:30:58 -0700 |
---|---|---|
committer | elijah <elijah@riseup.net> | 2014-06-27 23:30:58 -0700 |
commit | 15ec7cbcb2b9a4c230c4b8a7f7b720c7dc047c61 (patch) | |
tree | f92a319b64090beb7ee9bcea231a1a4c816ab7dd | |
parent | 787eb366d80cee7c89348e11c1befa86255bbe85 (diff) |
added error() macro.
-rw-r--r-- | provider_base/lib/macros/core.rb | 6 | ||||
-rw-r--r-- | provider_base/services/couchdb.rb | 2 |
2 files changed, 6 insertions, 2 deletions
diff --git a/provider_base/lib/macros/core.rb b/provider_base/lib/macros/core.rb index 609111ac..2ab2e71b 100644 --- a/provider_base/lib/macros/core.rb +++ b/provider_base/lib/macros/core.rb @@ -39,10 +39,14 @@ module LeapCli if instance_eval(assertion) true else - raise AssertionFailed.new(assertion) + raise AssertionFailed.new(assertion), assertion, caller end end + def error(msg) + raise ConfigError.new(@node, msg), msg, caller + end + # # applies a JSON partial to this node # diff --git a/provider_base/services/couchdb.rb b/provider_base/services/couchdb.rb index c63e3a00..81f366e1 100644 --- a/provider_base/services/couchdb.rb +++ b/provider_base/services/couchdb.rb @@ -3,7 +3,7 @@ # unless nodes_like_me['services' => 'couchdb']['couch.master' => true].any? - #raise 'node `%s`, environment `%s`: there must be at least one node with couch.master set to `true` for this environment.' % [@node.name, @node.environment] + error('there must be at least one node with couch.master set to `true` for environment `%s`.' % @node.environment) end if couch.master |