]> projects.mako.cc - selectricity-live/commitdiff
Throw an ArgumentError if invalid election name is passed to casting
authorJohn Dong <jdong@mit.edu>
Fri, 17 Aug 2007 00:21:43 +0000 (20:21 -0400)
committerJohn Dong <jdong@mit.edu>
Fri, 17 Aug 2007 00:21:43 +0000 (20:21 -0400)
app/models/selectricity_service.rb

index 4075f6401fa40f889f16be53ac80fc7b17398d57..7da46e18abf7183abd8ef9498341771372cb08d4 100644 (file)
@@ -21,6 +21,8 @@ class SelectricityService < ActionWebService::Base
       voter.save!
       voter.vote.confirm!
       voter.save!
+    else
+      raise ArgumentError.new "Cannot find election #{election_name}"
     end
   end
   def quickvote_candidate_ids_to_names(shortname, id_list)

Benjamin Mako Hill || Want to submit a patch?