aboutsummaryrefslogtreecommitdiff
path: root/poll.rb
diff options
context:
space:
mode:
Diffstat (limited to '')
-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 = []