diff options
author | Benjamin Kellermann <Benjamin.Kellermann@gmx.de> | 2016-10-14 01:34:13 +0200 |
---|---|---|
committer | Benjamin Kellermann <Benjamin.Kellermann@gmx.de> | 2016-10-14 01:34:13 +0200 |
commit | af92765798574598edc29651fa306d8b2eb67004 (patch) | |
tree | 5933a7b06e6cc331124d9fbf5f3a220b5d347a79 /poll.rb | |
parent | 07c331e84c917f05c8d7cdb4d0316e5ef6728463 (diff) |
catch poll_type manipulation
Diffstat (limited to 'poll.rb')
-rw-r--r-- | poll.rb | 6 |
1 files changed, 5 insertions, 1 deletions
@@ -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 = [] |