summaryrefslogtreecommitdiff
path: root/lib/custodian
diff options
context:
space:
mode:
Diffstat (limited to 'lib/custodian')
-rw-r--r--lib/custodian/alertfactory.rb3
-rw-r--r--lib/custodian/testfactory.rb4
2 files changed, 7 insertions, 0 deletions
diff --git a/lib/custodian/alertfactory.rb b/lib/custodian/alertfactory.rb
index e176f6d..3df6233 100644
--- a/lib/custodian/alertfactory.rb
+++ b/lib/custodian/alertfactory.rb
@@ -31,6 +31,9 @@ module Custodian
#
def self.create( alert_type, obj )
+ raise ArgumentError, "The type of alerter to create cannot be nil" if ( alert_type.nil? )
+ raise ArgumentError, "The type of alerter to create must be a string" unless ( alert_type.kind_of? String )
+
c = @@subclasses[alert_type]
if c
c.new( obj )
diff --git a/lib/custodian/testfactory.rb b/lib/custodian/testfactory.rb
index f5e342d..ccfc89e 100644
--- a/lib/custodian/testfactory.rb
+++ b/lib/custodian/testfactory.rb
@@ -31,6 +31,10 @@ module Custodian
#
def self.create( line )
+
+ raise ArgumentError, "The type of test to create cannot be nil" if ( line.nil? )
+ raise ArgumentError, "The type of test to create must be a string" unless ( line.kind_of? String )
+
#
# If this is an obvious protocol test.
#