aboutsummaryrefslogtreecommitdiff
path: root/poll.rb
diff options
context:
space:
mode:
authorBenjamin Kellermann <Benjamin.Kellermann@gmx.de>2016-10-14 01:34:13 +0200
committerBenjamin Kellermann <Benjamin.Kellermann@gmx.de>2016-10-14 01:34:13 +0200
commitaf92765798574598edc29651fa306d8b2eb67004 (patch)
tree5933a7b06e6cc331124d9fbf5f3a220b5d347a79 /poll.rb
parent07c331e84c917f05c8d7cdb4d0316e5ef6728463 (diff)
catch poll_type manipulation
Diffstat (limited to 'poll.rb')
-rw-r--r--poll.rb6
1 files changed, 5 insertions, 1 deletions
diff --git a/poll.rb b/poll.rb
index c98bf22..aef966a 100644
--- a/poll.rb
+++ b/poll.rb
@@ -44,6 +44,10 @@ class String
return id
end
end
+
+class WrongPollTypeError < StandardError
+end
+
class Poll
attr_reader :head, :name
YESVAL = "a_yes__"
@@ -64,7 +68,7 @@ class Poll
when "time"
@head = TimePollHead.new
else
- raise("unknown poll type: #{type}")
+ raise(WrongPollTypeError, "unknown poll type: #{type}")
end
@data = {}
@comment = []