Skip to content

Commit

Permalink
Fix Exception matching for pre-1.8 Neo4j.
Browse files Browse the repository at this point in the history
  • Loading branch information
rdvdijk committed Oct 8, 2012
1 parent c2bbbff commit cc803eb
Showing 1 changed file with 8 additions and 7 deletions.
15 changes: 8 additions & 7 deletions lib/neography/connection.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit cc803eb

Please sign in to comment.