summaryrefslogtreecommitdiff
path: root/lib/oxidized/hook.rb
diff options
context:
space:
mode:
authorSaku Ytti <saku@ytti.fi>2018-06-07 22:08:15 +0300
committerSaku Ytti <saku@ytti.fi>2018-06-07 22:08:15 +0300
commita843b5cff1ffa7bba11281402694b992b12a448b (patch)
treeb71abedc753dc4e27725a430a6765a98e9211898 /lib/oxidized/hook.rb
parent63c5ff8265f9cb4920caf64d53dc655118de02a0 (diff)
Refactor manager, take2
Make all the add_* return falsy valuem and make all the callers raise, this has benefit that the caller has more information, like it can tell what node we were trying to load when model failed to load. We were only failing to do this in two places in the code, source and plugin.
Diffstat (limited to 'lib/oxidized/hook.rb')
-rw-r--r--lib/oxidized/hook.rb2
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/oxidized/hook.rb b/lib/oxidized/hook.rb
index 915299b..2eb6f87 100644
--- a/lib/oxidized/hook.rb
+++ b/lib/oxidized/hook.rb
@@ -37,7 +37,7 @@ module Oxidized
"unknown event #{event}, available: #{Events.join ','}"
end
- Oxidized.mgr.add_hook hook_type
+ Oxidized.mgr.add_hook(hook_type) or raise("cannot load hook '#{hook_type}', not found")
begin
hook = Oxidized.mgr.hook.fetch(hook_type).new
rescue KeyError