Permalink
Browse files

Fix Exception matching for pre-1.8 Neo4j.

  • Loading branch information...
1 parent c2bbbff commit cc803ebc5786844b796b4b530b8f81ee9b95d9bf @rdvdijk rdvdijk committed Oct 8, 2012
Showing with 8 additions and 7 deletions.
  1. +8 −7 lib/neography/connection.rb
@@ -114,13 +114,14 @@ def handle_4xx_response(code, body)
case code
when 400, 404
case parsed_body["exception"]
- when "SyntaxException" ; raise SyntaxException.new(message, code, stacktrace)
- when "PropertyValueException" ; raise PropertyValueException.new(message, code, stacktrace)
- when "BadInputException" ; raise BadInputException.new(message, code, stacktrace)
- when "NodeNotFoundException" ; raise NodeNotFoundException.new(message, code, stacktrace)
- when "NoSuchPropertyException" ; raise NoSuchPropertyException.new(message, code, stacktrace)
- when "RelationshipNotFoundException" ; raise RelationshipNotFoundException.new(message, code, stacktrace)
- when "NotFoundException" ; raise NotFoundException.new(message, code, stacktrace)
+ when /SyntaxException/ ; raise SyntaxException.new(message, code, stacktrace)
+ when /this is not a query/ ; raise SyntaxException.new(message, code, stacktrace)
+ when /PropertyValueException/ ; raise PropertyValueException.new(message, code, stacktrace)
+ when /BadInputException/ ; raise BadInputException.new(message, code, stacktrace)
+ when /NodeNotFoundException/ ; raise NodeNotFoundException.new(message, code, stacktrace)
+ when /NoSuchPropertyException/ ; raise NoSuchPropertyException.new(message, code, stacktrace)
+ when /RelationshipNotFoundException/ ; raise RelationshipNotFoundException.new(message, code, stacktrace)
+ when /NotFoundException/ ; raise NotFoundException.new(message, code, stacktrace)
else
raise NeographyError.new(message, code, stacktrace)
end

0 comments on commit cc803eb

Please sign in to comment.