Skip to content
Browse files

raise exception on error

  • Loading branch information...
1 parent f7a0a84 commit cc3e59e5e7319a72bcb899a412f9c49dbbbaf571 @jpmckinney jpmckinney committed Nov 18, 2012
Showing with 3 additions and 0 deletions.
  1. +3 −0 lib/gov_kit/vote_smart.rb
View
3 lib/gov_kit/vote_smart.rb
@@ -105,6 +105,9 @@ def self.find(candidate_id, include_office = false)
class Category < VoteSmartResource
def self.list(state_id)
response = get("/Rating.getCategories", :query => {"stateId" => state_id})
+
+ raise(ResourceNotFound, response['error']['errorMessage']) if response['error']
+
parse(response['categories']['category'])
end
end

0 comments on commit cc3e59e

Please sign in to comment.
Something went wrong with that request. Please try again.