diff options
author | Steve Kemp <steve@steve.org.uk> | 2012-11-26 15:05:18 +0000 |
---|---|---|
committer | Steve Kemp <steve@steve.org.uk> | 2012-11-26 15:05:18 +0000 |
commit | d79f8f76d1b8a0940814f41760f1387d0e1364d9 (patch) | |
tree | c12309e956ad1b0f1fb0d0536c82bad0ea206d2d /lib/custodian/alerts/mauve.rb | |
parent | 62741cbbb0df2bfe040063f9a04670f09b5a9363 (diff) |
Don't attempt to raise/clear with redis/mauve unless they were loaded.
Diffstat (limited to 'lib/custodian/alerts/mauve.rb')
-rw-r--r-- | lib/custodian/alerts/mauve.rb | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/lib/custodian/alerts/mauve.rb b/lib/custodian/alerts/mauve.rb index 37ed539..417a1f2 100644 --- a/lib/custodian/alerts/mauve.rb +++ b/lib/custodian/alerts/mauve.rb @@ -29,6 +29,11 @@ module Custodian # attr_reader :test + # + # Was this class loaded correctly? + # + attr_reader :loaded + @@ -41,8 +46,10 @@ module Custodian begin require 'mauve/sender' require 'mauve/proto' - rescue LoadError - raise "ERROR Loading mauvealert libraries!" + @loaded = true + rescue + puts "ERROR Loading mauve libraries!" + @loaded = false end end @@ -54,6 +61,7 @@ module Custodian # def raise() + return unless( @loaded ) # # Get ready to send to mauve. @@ -88,6 +96,8 @@ module Custodian # def clear + return unless( @loaded ) + # # Get ready to send to mauve. # |