aboutsummaryrefslogtreecommitdiff
path: root/lib/mauve
diff options
context:
space:
mode:
authorPatrick J Cherry <patrick@bytemark.co.uk>2012-04-28 13:15:02 +0100
committerPatrick J Cherry <patrick@bytemark.co.uk>2012-04-28 13:15:02 +0100
commite141a801070932e2925177bdf9f61c598d1c8dfd (patch)
tree330af87c425fdc43cd37a34da3ad912aafed4d88 /lib/mauve
parent4ed2e5510c188d92007bc78d2141f59cff07ba0b (diff)
Updated Person to give back sane error messages.
Diffstat (limited to 'lib/mauve')
-rw-r--r--lib/mauve/person.rb14
1 files changed, 7 insertions, 7 deletions
diff --git a/lib/mauve/person.rb b/lib/mauve/person.rb
index 9ea36f7..a4acaf0 100644
--- a/lib/mauve/person.rb
+++ b/lib/mauve/person.rb
@@ -47,21 +47,21 @@ module Mauve
# Sets the Proc to call for urgent notifications
#
def urgent=(block)
- raise ArgumentError unless block.is_a?(Proc)
+ raise ArgumentError, "urgent expects a block, not a #{block.class}" unless block.is_a?(Proc)
@urgent = block
end
# Sets the Proc to call for normal notifications
#
def normal=(block)
- raise ArgumentError unless block.is_a?(Proc)
+ raise ArgumentError, "normal expects a block, not a #{block.class}" unless block.is_a?(Proc)
@normal = block
end
# Sets the Proc to call for low notifications
#
def low=(block)
- raise ArgumentError unless block.is_a?(Proc)
+ raise ArgumentError, "low expects a block, not a #{block.class}" unless block.is_a?(Proc)
@low = block
end
@@ -69,7 +69,7 @@ module Mauve
#
#
def email=(arg)
- raise ArgumentError unless arg.is_a?(String)
+ raise ArgumentError, "email expects a string, not a #{arg.class}" unless arg.is_a?(String)
@email = arg
end
@@ -77,7 +77,7 @@ module Mauve
#
#
def sms=(arg)
- raise ArgumentError unless arg.is_a?(String)
+ raise ArgumentError, "sms expects a string, not a #{arg.class}" unless arg.is_a?(String)
@sms = arg
end
@@ -85,7 +85,7 @@ module Mauve
#
#
def xmpp=(arg)
- raise ArgumentError unless arg.is_a?(String)
+ # raise ArgumentError, "xmpp expected a string, not a #{arg.class}" unless arg.is_a?(String) or arg.is_a?(Jabber::JID)
@xmpp = arg
end
@@ -93,7 +93,7 @@ module Mauve
#
#
def password=(arg)
- raise ArgumentError unless arg.is_a?(String)
+ raise ArgumentError, "password expected a string, not a #{arg.class}" unless arg.is_a?(String)
@password=arg
end