Skip to content

Commit

Permalink
Catch weird error messages better
Browse files Browse the repository at this point in the history
  • Loading branch information
kyledrake committed Oct 11, 2011
1 parent 7c3ef3e commit 38c5cf6
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion lib/geoloqi/session.rb
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ def run(meth, path, query=nil, headers={})

if hash.is_a?(Hash) && hash['error'] && @config.throw_exceptions
if @config.use_dynamic_exceptions && !hash['error'].nil? && !hash['error'].empty?
exception_class_name = hash['error'].split('_').collect {|w| w.capitalize}.join+'Error'
exception_class_name = hash['error'].gsub(/\W+/, '_').split('_').collect {|w| w.capitalize}.join+'Error'
Geoloqi.const_set exception_class_name, Class.new(Geoloqi::ApiError) unless Geoloqi.const_defined? exception_class_name
raise_class = Geoloqi.const_get exception_class_name
else
Expand Down
2 changes: 1 addition & 1 deletion lib/geoloqi/version.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
module Geoloqi
def self.version
'0.9.31'
'0.9.32'
end
end

0 comments on commit 38c5cf6

Please sign in to comment.